Run Function Every 2 hours

martinjward

Registered User.
Local time
Today, 16:33
Joined
Sep 28, 2007
Messages
22
Hi

I have a database that has a process that I wish to run every two hours, between the hours of 7am and 7pm. Does anyone have any pointers as to how I can do this?

I am using Access 2007 on Win XP.
 
If your Database is always up and running then you could use the SetTimer and KillTimer Windows API functions. If you need a sample how to do this then just let me know.

If your Database is not always up and running then you can Use the Windows Scheduler to fire up Access at a specific time and run a AutoExec macro when it starts or set a different macro from the Access Command line.

.
 
My intention is to have the access DB running all of the time, so an example would be appreciated.

Thanks in advance.
 
Ok then....attached is a small MS-Access mdb file I quickly punched together to demonstrated the use of the SetTmer and KillTimer API Functions for your particular (and other) requirement.

Look at the code within the modules. It may look like a lot of code but it really isn't. There is a lot of commenting in the code so that you can see what does what.

Hope it helps.

.
 

Attachments

Users who are viewing this thread

Back
Top Bottom