Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling an ACCESS MACRO to run in SCHEDULED TASKS

Status
Not open for further replies.

PSUIVERSON

Technical User
Nov 6, 2002
95
0
0
US
I am trying to schedule a MACRO to run each morning after a certain dataset is updated on the network. How would I do this? I am familiar with SCHEDULED TASKS and how to setup programs to run through the WIZARD and have seen other's running MACRO's in scheduled tasks but cannot figure this out.

Thanks ahead of time!
 
There is a good Access Forum on Tek-tips, but what you need to do is create a command line for access, and use the /x macroname command line parameter.
 
You can use the Scheduled Tasks Manager to startup the .MDB file which will open the Access database. Use the AUTOEXEC macro in Access, which automatically starts when Access opens, to import your new data upon opening and then quit closing the application when through.
 
Create a batch file to open access and run the macro. Then scheudule the batch file. Here's a sample of the batch file:
--------------------------------------------------
echo off
cls

REM IMPORT
REM -------

"C:\Program Files\Microsoft Office\Access2000\Office\MSACCESS.EXE" \\web\inetpub\database\MergeDuplicates.mdb /x mcrAppendTblMerge


REM EXIT
REM -----
exit
--------------------------------------------------------
First enter the filepath for the Access executable. Then enter the filepath of the .mdb. Then add "/x" followed by a space and the macroname.

Be sure that when you create the batch file you have "word wrap" turned OFF in notepad.

I hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top