I am trying to make a macro run nightly. I have a task scheduler to open the database, and on the opening form I have put a time interval code set. However, I am unsure what time interval amount I should put. Let's say I put 6000. Upon testing this, it printed the report continuously every 6 seconds.
How can I make it run just once, then stop?
This is the code I used, thanks to a 2007 post on here:
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Timer()
- If intCounter > 1 Then
- Me.TimerInterval = 0
- DoCmd.Quit
- Else
- DoCmd.RunMacro "mcrTest"
- End If
- intCounter = intCounter + 1
- End Sub