-
Does anyone know of a way to run a procedure at specified time intervals, say hourly, without using the Timer control. The Timer control only allows for short time intervals (I think its 64000 milleseconds?). I guess you could nest the controls and have one elapsed interval initiate another Timer (and so on...) but this would be the brute force method. I am sure there is a more elegant way.
shawn
-
You should probably just get the current system date/time using the DateDiff Function. Or just use DateAdd function and add an hour to the current system time.
Need more?
-deadBird
-
I asked that one a few months ago, everywhere I went said the ssame thing, to schedule any processes rather than the time control, use the winNT / win98 task scheduler.
http://forums.vb-world.net/showthrea...threadid=23136
-
it depends what you want to do.
the sheduler will run an app when sheduled but if you want the app to be running all the time and just run code periodically you can do this:
Code:
Option Explicit
Dim Runtime As Date
Private Sub Form_Load()
resetRunTime
End Sub
Private Sub Timer1_Timer()
If Now > Runtime Then
resetRunTime
DoYourStuff
End If
End Sub
Private Sub resetRunTime()
Runtime = DateAdd("n", 60, Now)
End Sub
Private Sub DoYourStuff()
MsgBox "Enter code to run here"
End Sub
[Edited by Mark Sreeves on 10-03-2000 at 10:18 AM]
-
Thanks deadBird for the start and thanks Mark for the example code. I wanted to keep a status board up all the time and have code update the board every hour. This code will do the trick.
thanks,
shawn