Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write module to set time schdule to run automatically?

Status
Not open for further replies.

acin0026

Technical User
Feb 5, 2001
12
TH
I had a macro to run my work. However, I would like to have this macro to run task automatically at 6:00 AM. I think I need to write the module. What is the code to do this?

thank for your help.
 
Hi!

You can try it:

Private Sub Form_Timer()
'You need to place interval (milisecondes: 30000 = 30 seconds) on forms timer interval
If Time >= #6:00:00 AM# Then 'Compare time
DoCmd.RunMacro "MacroName"
Me.TimerInterval = 0 'Stop On Time event further
End If
End Sub

Aivars

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top