Run Function Every 2 hours (1 Viewer)

martinjward

Registered User.
Local time
Today, 02:26
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.
 

CyberLynx

Stuck On My Opinions
Local time
Yesterday, 18:26
Joined
Jan 31, 2008
Messages
585
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.

.
 

martinjward

Registered User.
Local time
Today, 02:26
Joined
Sep 28, 2007
Messages
22
My intention is to have the access DB running all of the time, so an example would be appreciated.

Thanks in advance.
 

CyberLynx

Stuck On My Opinions
Local time
Yesterday, 18:26
Joined
Jan 31, 2008
Messages
585
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

  • Window API Timer Example.zip
    23.7 KB · Views: 122

Users who are viewing this thread

Top Bottom