Pause?

Smudger

Smudger UK
Local time
Today, 22:02
Joined
Sep 5, 2005
Messages
7
Hi All,
I am trying to automate a macro to run every hour. Is there such thing as a "Pause" or "Wait" function. I am trying to do this in a macro as I am rubbish at VBA!!!

Any advice - Other than "Get on a VBA course!"

Cheers

Mark
 
Public Function TimerDelaySecs(DelayInSecs As Integer)

Dim dteSetDelay As Date

dteSetDelay = DateAdd("S", DelayInSecs, Now())

While Now() < dteSetDelay

Wend

End Function
 
How do I put this into the database

As I said before - I am not good at this stuff ;o)
 
While that code will work, it will dang near tie up the PC it is running on. If that is an issue you can code a timer event on a form (you can keep it minimized) that fires every X seconds and when an hour is reached, run whatever you need and resets itself. One other option is to schedule via task manager a job every hour that starts access, and then access runs a macro to do your tasks and then quits.
 

Users who are viewing this thread

Back
Top Bottom