running queries at a specified time

Chimp8471

Registered User.
Local time
Today, 10:33
Joined
Mar 18, 2003
Messages
353
i need to run 2 queries, at 2 seperate times,

query 1

needs to be run every morning at 10:00 am

but

query 2

needs to run every monday morning at 9:30 am

can this be done??

if so how please

cheers


Andy
 
Hi!

unfortunatly not as simple as Excel (Using application.ontime) but still fairly straightforward.

There are actually two ways to do this, which one you choose will depend upon your needs...

The first method is to have the database running all day long. When the database opens, you open a form with a timer control. Have the timer event run every 5 minutes or so and check the time with a simple IF statement, once it reaches or passes your specified times run the relevant code.

The second method uses Schecduled tasks. Create 2 macros (Macros not VBA), one for each timed event, that call your relevant code. Then set up two scheduled tasks to run at your required times. When you create the Sched tasks, you just call the database files and then use the /x command line option plus the name of the macro you wish to run. So for example...

"C:\northwind.mdb" /x FirstMAcro

The above would open Northwind then run the macro First Macro.

The second method means that your database does not need to run all day long, the only thing to remember with the 2nd is that you need to quit Access after each macro finishes running.


hope that helps:cool:
 
Hi i have similar problem. Maybe one of you can help. I need to create a backup of the db that is being used by the users all day after every 2 hrs. It is also ok if it overwrites. i have a backup code which works with the click of a button but that would require some one to click on it. Rather it would be more helpful if it can run on its own every 4 hrs say so that it runs twice in day.
 

Users who are viewing this thread

Back
Top Bottom