Task Schedule???

gblack

Registered User.
Local time
Today, 15:52
Joined
Sep 18, 2002
Messages
632
OK is there any way to have Access run a daily task (like opening a query) automatically?

If so . . .how do I do this?
 
In the "OnOpen" event property of your main form, you can place the following code:

Docmd.openquery "querynamehere"

Once your main form opens, the query should run as well.

edtab
 
OnOpen will work but only once. If you set a Timer event and then an If.... Then statement that checks the System Time and runs the required code/query if the If statement is satisfied. It will run at the set time every time. But with the stability of Access I wish you luck.

Jon.
 
Timer Event?

Can you help me out on "timer event"? I'm not sure how to do this. . .

Thanks
Gary
 
Do not use a timer for this purpose. It presupposes that Access is open at the intended time, which might not be correct.

Write a macro that either runs a query or runs some code (or both) to accomplish your goal. Debug the query/code combo until it does what you want when you run it by hand.

Then use the WINDOWS task scheduler to activate Access. You should search this forum for how to activate a macro from a command line. It is the /X {macro name} switch that will do the job for you.

Basically, you create a shortcut icon for Access and your indicated database. Edit the icon's command line to include the /X macro-name data. Then tell Windows when you want this run.

Unfortunately, given the stability of Windows long-term, I have no greater confidence in this method than JonH did in using purely Access facilities to do the same thing.
 
OK great. . .thanks for the suggestions. This idea sounds like the best bet so far, so I'll give that a shot.

Thanks guys!
 

Users who are viewing this thread

Back
Top Bottom