Close Database Function?

I want to use task scheduler to open an Access DB, run a macro that updates a 
table from an external source, then close the DB and Access.  I do not use 
any forms on this database, just one table and one macro.  

So I guess my needs are as follows:
1. Automatically execute 'My_Macro' when the DB is opened from Task 
Scheduler.  My Scheduled Task uses the /X switch to specify and execute the 
Macro - my main problem is determining how to programatically close the DB 
and Access. I would like to continue using the command line method of 
executing the macro if possible so that I can manually open the database 
easily to do administrative tasks.

2. Once all macro operations are completed, automatically close the DB and 
the Access program.  

Your suggestions are greatly appreciated!!!!

Scott
0
Utf
1/9/2008 11:44:35 PM
access 16762 articles. 3 followers. Follow

2 Replies
914 Views

Similar Articles

[PageSpeed] 9

On Wed, 9 Jan 2008 15:44:35 -0800, PcolaITGuy
<PcolaITGuy@discussions.microsoft.com> wrote:

>2. Once all macro operations are completed, automatically close the DB and 
>the Access program.  
>

Just put

Quit

in the action of the last step of the macro.

             John W. Vinson [MVP]
0
John
1/10/2008 12:45:35 AM
=?Utf-8?B?UGNvbGFJVEd1eQ==?= <PcolaITGuy@discussions.microsoft.com>
wrote in news:8367D4D8-B3BE-40B9-A12D-41A511FB9B16@microsoft.com: 

> I want to use task scheduler to open an Access DB, run a macro
> that updates a table from an external source, then close the DB
> and Access.  I do not use any forms on this database, just one
> table and one macro.  
> 
> So I guess my needs are as follows:
> 1. Automatically execute 'My_Macro' when the DB is opened from
> Task Scheduler.  My Scheduled Task uses the /X switch to specify
> and execute the Macro - my main problem is determining how to
> programatically close the DB and Access. I would like to continue
> using the command line method of executing the macro if possible
> so that I can manually open the database easily to do
> administrative tasks. 
> 
> 2. Once all macro operations are completed, automatically close
> the DB and the Access program.  
> 
> Your suggestions are greatly appreciated!!!!
> 
> Scott
> 
Create a new macro, that has 2 steps: the first is RunMacro with 
your existing macro as the macro to run, and the second step 
executes the Quit action. Save your macro as My_Macro_CloseDb.

Change the /x parameter to the name of the new macro

-- 
Bob Quintal

PA is y I've altered my email address.

-- 
Posted via a free Usenet account from http://www.teranews.com

0
Bob
1/10/2008 11:17:50 PM
Reply:

Similar Artilces:

Get PCI Bus/Function/Device Number
Hi All, Is there a way to get the PCI bus, function and device number on which my current driver is installed. I could only find bus number in DEVICE_REGISTRY_PROPERTY. I had used WdfDeviceQueryProperty to retrieve this data. How can I get the function and device number? Thank You. Regards, Sushma Sushma <sushma.yella@gmail.com> wrote: > >Is there a way to get the PCI bus, function and device number on which >my current driver is installed. Why? That information is not very useful. >I could only find bus number in >DEVICE_REGISTRY_PROPERTY. I h...

Open and closing Excel
Hi Can anyone help with the attached error message? I am using Excel 2000 I get the message each time I open and close Excel Regards:confused: Attachment filename: errormessage.xls Download attachment: http://www.excelforum.com/attachment.php?postid=397805 --- Message posted from http://www.ExcelForum.com/ http://snipurl.com/3nvm google threads discussing this problem and fixes. Actually you could have described the error message without the attachment. Most people won't open attachments for fear of Viruses. I am fearless(or not too bright)! Gord Dibben ...

Excel generated errors-closing
I have a spreadsheet that I can no longer open. (Excel 2000, Windows 2000 OS, on a network). When I try to open, I get the error "Excel.exe has generated errors..." and the program closes. I have turned off all add-ins with no change. I have multiple users that can not open this spreadsheet, and multiple user that CAN open it. The problem seems to have started around the time of the Sasser virus. We ran every patch/update (except service pak 4) in the Windows library. Before that, no one had any problems with the spreadsheet. Also, I had some users that could open it (after the u...

closing a website
I have a masterpage that has a hyperlink in the header titled 'Log Out'. The intent is to have the user select this and it would end all sessions for all apps that were open and go back to the log in screen. I was looking at using the following 2 lines to accomplish this. Session.Abandon(); Response.Redirect("LogIn.aspx"); But, it seems that these are causing havoc when I go to run the website. By havoc, I mean the website does not want to load. Either the 2 lines are not correct or I am putting them in the wrong place. Is there a better way to close...

Outlook 2003 just closes down by itself
Hi, Outlook 2003 (SP3, all updates) goes along happily, then just closes down by itself. This behaviour seems to have happened since the Microsoft April security updates, but that might not have anything to do with it. Any one have any pointers I can explore please? Thanks, Steve Maincat wrote: > Hi, > > Outlook 2003 (SP3, all updates) goes along happily, then just closes down by > itself. This behaviour seems to have happened since the Microsoft April > security updates, but that might not have anything to do with it. What happens if you load Outlook in its safe...

Database Size difference after execution
I have recently converted an Access 97 application to Access 2002, simply put all the application does is read in a datafile, run calculations, and output a new datafile. What I have noticed in testing the conversion is that at the end of the execution the Access 2002 database is nearly 3 times the size of the Access 97 database running the same execution. Once a manual compact is done the Access 2002 database is much smaller however during execution is is exceeding 2GB in size depending on the input file compared to 800MB with the Access 97 version. My question is if anyone has a...

Looking for simple database alternative to Excel
The 65K row limit in Excel presents a lot of challenges to me in working with large data sets. Upgrading to Excel 2007 isn't an option for me. Can someone recommend some simple, free database software as an alternative to Excel? <cmotes@gmail.com> wrote in message news:1189273330.364534.62120@g4g2000hsf.googlegroups.com... > The 65K row limit in Excel presents a lot of challenges to me in > working with large data sets. > > Upgrading to Excel 2007 isn't an option for me. > > Can someone recommend some simple, free database software as an > alternative t...

Converting Databases
Anyone familiar with or have any tips on converting a Microsoft Fox Pro database into something usable by Microsoft Dynamics Point of Sale? Phill pmoreland@abm-md.com pimoreland@gmail.com wrote: > Anyone familiar with or have any tips on converting a Microsoft Fox > Pro database into something usable by Microsoft Dynamics Point of > Sale? manually with query cod ...

Function to find largest number from a series of numbers?
Is there a function to go across several columns of numbers and pick out the largest one? If not, how would I write that function? thanks to all Rick =MAX(A1:Z1) -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "rs" <r_schiller@REMOVEcomcast.net> wrote in message news:2p-dnW3P0f...

MSCRMDistribution database
Just wondering if anyone can tell me what the purpose of this particular database is? The reason I ask is that it is huge on my system, over a gig in size (and growing about 10MB per day), but the MSCRM database is only about 350MB in size. Does it have anything to do with the replication publications (it looks like it does)? Assuming it is, are the replication publications something I really need, only having a single SQL server? I'm not real familiar with this aspect of MSSQL, it's just that I'm really shaking my head at this Distribution database size. I've truncated the l...

JET database errors
Does anyone know of a tool that can repair JET database errors? ESUTIL isn't very good at doing this. Many thanks. Andy Hi - this is an Outlook newsgroup - I suggest you post your question (with a lot more detail about your version of Exchange and specific symptoms) to an Exchange group. Andy wrote: > Does anyone know of a tool that can repair JET database > errors? ESUTIL isn't very good at doing this. > > Many thanks. > Andy ...

Excell IF Function
I am trying to use the IF function to total a row, if the sum is greater than 40 then the answer given back would be 40. This for a payroll workbook. Any help is appreciated. =IF(SUM(A1:Z1)>40,40,SUM(A1:Z1)) because you requested an IF function. Better is: =MIN(40,SUM(A1:Z1)) For whole row substitute IV1 for Z1. ----- Marc wrote: ----- I am trying to use the IF function to total a row, if the sum is greater than 40 then the answer given back would be 40. This for a payroll workbook. Any help is appreciated. Marc, how about something like this =IF(SUM(A1:J1)>4...

Cannot connect to database after reformatting computer
I am using RMS 1.3 with MSDE Server. My customer's computer died, they had not been backing up since Oct. 08. When they reloaded windows and I reloaded Server, I can no longer access the old database. What can I do? Is the old database recoverable? Does not see that database when I go to Administrator in RMS. Thanks. Are you able to locate the MDL and LDL files? If so you could try to attach the database through SQL .and then backup the database and reinstall it under RMS Store Operations Administrator. "Roxanne" wrote: > I am using RMS 1.3 with MSDE Server. My custom...

Function "IF"
Hi all, was wondering if it is possible to write the logical test of th function "IF" in words. For eg., usually the test function is i numbers, IF (E4 =< 3,G3,G4). But what if I want a cell to return th word "open" when the previous cell has no date entered and "close" whe a date is entered, what do I have to do? I tried IF (G4=AN NUMBer,Close, Open) but of course it doesn't work. So what can I do? Thanks -- Message posted from http://www.ExcelForum.com One way: =IF(ISNUMBER(G4),"Close","Open") In article <Rae.19o8ah@exce...

Looking for API Function for Overlaying two Icons,...
Hi, if i am right, i rememer a Windows API function, that could take a icon handle as input and draw a Exclamation icon on its lower-right surface. I remember these function as a very simple function, that could take a source icon handle, and/or a target icon handle and/or some additional flags, but i cant find these function. I am pretty sure that there was such a function in the windows API/Shell/GDI or wherever but i am relly sure, i just cant find it! Maybe i am wrong,... Does someone know these function? Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre b...

I'm a newbie please help with my function
I have an excel spreadsheet that has 2 columns of numbers side by side. I want a formula that counts the number of times the number in colum one are larger than the number that is right beside it in column two. After it counts it I want to display the total number that are large in a seperate cell. Is this possible. I cruised around the forum an I did not see what I was looking for so any help would be appreciated -- colincanno ----------------------------------------------------------------------- colincannon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26...

can not close outlook 2003 normally
After I close outlook2003, I still can see the outlook icon stay in the right corner, and I still can see the outlook.exe in the processes list of task manager. I use outlook2003 and exchange 2000. Anybody knows how to debug or fix this problem? It seems can not close outlook2003. Some common reasons why Outlook will not shut down completely when you click either the X or Exit: 1. PDA synchronization software with your PDA in the cradle. 2. WinFax Pro (especially 10.02 in Outlook 2003) - contact their support for an alleged fix. 3. Franklin-Cover Plan Plus! 4. COM Add-ins. 5. Mail r...

Reprint year end closing journal for GL
We had a printing problem when I did our system year end so nono of the posting journals printed. I could reprint the BBF journal but I can not find the the journal that clears out the P&L accounts to the retained earnings. Is there a way to reprint this? Thanks -- Pieter ...

Full Recovery versus Simple database backup
Has anyone experienced any issues/problems with converting the database to Full Recovery mode rather than Simple? I plan on scheduling this for the middle of the night as to not slow down my network, but wondered if there would be any other issues associated with this change. Thanks Adam Hi Adam. You should not see any performance in your network from converting from simple model to full recovery mode. Many will tell you that your transaction logs will not grow in simple recovery, but there is growth. Yet there is a great deal more in Full Recovery mode. Once you make the change,...

Searching closed leads and opening originating lead from contact
I don't see anyway to modify the search fields used on the look for: function to work on closed leads. We frequently have to go back to closed leads to view notes/history that did not transfer when the lead was converted and we can't find a way to search. When I chose "closed leads" or a custom view "my closed leads" the search dialog still searches only open leads. Is there any easy way to add searching of closed views without having to do an advanced find each time? I also notice the converted contact and account has a Originating Lead attribute - is th...

OL2007, messages don't always close after sending
Let's say I've just finished a spreadsheet and I want to send it to someone. I'll click the big Office button and choose Send -> Email, and up pops a new email message with my spreadsheet attached. All fine so far until I click the Send button (or Alt-S, or Ctrl-Enter, doesn't matter which). The message appears in the Outbox and Outlook will send it, but it also stays open in front of Excel until I click the Close button. I can still make further edits to my workbook, but the email message is in the way and I can't see what I'm doing, until I manually close...

Date cells after conversion from Database
In our organisation we are dealing with different date formats (dd/mm/yyyy or mm/dd/yy) When information is requested out of our JDE database it is presented as a csv file. After convertion into Excel the 'dd/mm/yyyy' are recognised as date formats, but the 'mm/dd/yy' only as general formats. How do I change those last ones in recogniseable date formats? Thanks for your help!!!! Rene. if you can highlight them all then right click and choose format cells then under the number tab choose custom then enter mm/dd/yy in the to box. that might help cheer -- Message po...

Toggling "Shutter Bar Open/Close Button"
I would like to expand and contract "Shutter Bar Open/Close Button" inside a module. However, I haven't figured out what method or code is needed in order to manipulate it. I would also like to be able to expand or contract features on the Shutter bar (Navigation Bar) like Forms, Queries, etc. Any ideas? ...

How do I run a SQL query against a MS SQL Server database from exc
How do I run a SQL query against a MS SQL Server database from within Excel 2002? I know it can be done somehow using the SQL.Request addin function. However my attempts using this function have continually failed. Can some one please provide a working example to the pubs or Northwind dbs that I can work with and use to help debug my attempt? Thank you! ...

HELP! Outlook pauses when closing a window
I hope I am posting in the correct place. I have a problem which only occurs on one machine (of two) in a small network. Both are connected to a little IMAP server, but this one machine "pauses" (actually does a time-out eventually) after replying to a message and then closing the original message. It doesn't do it on every message (but there seems no common thread). The other machine (same hardware and software) does not exhibit this behaviour. Have switched to Outlook Express at the moment - that also seems okay. Anyone got any ideas? I have re-installed Outlook and deleted t...