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 Westi 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 Task 2

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Feb 8, 2002
210
GB
I need to run some make table reports overnight when nobody is in my office. Is it possible either by using just VBA in access or combining this with scheduled tasks on my computer to get a make table query to run at a specified date/time?

I have some suucess doing this with other office applications but have used an auto_open routine... As the database is used buy other users i don't really want the make table query to run everytime the database is opened....
 
Hi!

Set up a public function to run the query you want. Do a time check first to make sure it is between 4:00am and 4:10am. You can then use the autoexec macro to run the code when the database opens. Finally, have your scheduling program open the database at the appropriate time so the code will run.

hth
Jeff Bridgham
bridgham@purdue.edu
 
You can use the Windows Task Manager to schedule your database to run at a specific time. To launch the database via Windows Task Manager, in the Run box, type the following:

"c:\...\msaccess.exe" "C:\yourdatabase" /x "NameOfMacroToRun"
Note that the /x option tells Access not to run the AutoExec file upon opening, but rather open the macro you specify.

You could, within Access, create a shortcut to the macro you plan to launch and reference the shortcut in the Run Box.
 
In my last post I mistakenly said to use the Windows Task Manager. It should have said the Windows Task Scheduler.
 
Windows Task Scheduler is okay but it (arguably) compromises the security of your database, as anyone using your PC can open the Scheduler and view your database or user account passwords.

I prefer to use the Handy Access Launcher (HAL) to do the same job but without compromising database security and at the same time using less system resources than Windows Task Scheduler.

HAL can be found at either or and is freeware. [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top