General information
Category:
Coding, syntax & commands
Yes I believe the timer resets after the end of the day. If it's every twenty minutes you can provide your own track of time by establishing a static or module level variable that gets updated at every timer interval and check the elapsed time using this.
Say you set your timer to fire every second, then add the second to your static variable and check the number of seconds that have elapsed to the desired interval.
' at module level
Dim intSeconds As Long
' (set timer to fire every second)
' this inside timer event:
intSeconds = intSeconds + 1
If intSeconds > = 60 'interval set to every minute..
Call Do_My_Thing
intSeconds = 0
End If
HTH
>Hello every one,
>
>I have time elapse problem with timer function. I required execute one function after every 20 minutes. Its work normal but AM and PM make problem for me. For example I store timer value at 11:50 PM. My function need to be executed at 12:10AM. But its not run so I reload whole program again it work normal. Please tell me how I can solve this problem.
>
>Thank you,
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only