Running macros or VBA on specific time in Access

Nishikawa

Registered User.
Local time
Today, 15:14
Joined
May 17, 2007
Messages
97
Hi,

I been trying to make my database updates certain tables on a few specific times on the day. (e,g 2pm and 6pm) I tried using a Do while loop (which hangs the entire database) and Dlookup (which did not work) without much success.

Can someone kindly enlighten me please?
 
2 general techniques. One is a timer running on a form that checks for the appropriate time, does its thing if true. My normal method is to create a "utility" mdb that performs the desired task when started, then closes itself. Then I fire that off from Scheduled Tasks.
 
hmm.... I dun think a timer will work as it is supposed to run the macro based on system time, not time length. I need the macro to run when the time is 1400hrs and 1800 hrs.
 
in the timer code check the system time and keep a record of the last time checked. this will enable you perform a task close to the actual time(s)
 
do while is ok surely

inside the loop you need to put

doevents

that releases access to do other things while the do loop is processing
 
One is a timer running on a form that checks for the appropriate time, does its thing if true

I mentioned that it should be checking the time. That method of course requires the db be left open. I think a timer would be more efficient that a loop with DoEvents, but as noted my preference would be a stand alone mdb fired off from Scheduled Tasks.
 
in the timer code check the system time and keep a record of the last time checked. this will enable you perform a task close to the actual time(s)

I'm a VBA idiot, can you please teach me how to do it?
 

Users who are viewing this thread

Back
Top Bottom