Learning by pecking away....
- Local time
- Yesterday, 22:14
- Jun 26, 2007
Hello, I have a countdown timer that runs in the On_Load when the form opens and runs some code in the Form_Timer() after every 10 minutes. I also have a button cmdRunLogger that I need to reset the timer and run the code in the Form_Timer() again like it did when the form loaded. The cmdRunLogger button isnt doing anything but clicking once stops timer countdown and click again restarts timer but doesnt run the code again. What and where in whole process needs fixed?
Dim StartCount As Long ' Private Function StartCounter() If Me.TimerInterval = 0 Then StartCount = 600 '10 Minutes in seconds Me.TimerInterval = 1000 Else Me.TimerInterval = 0 End If End Function Private Sub cmdRunLogger_Click() 'Start the timer to run again in ??min Call StartCounter End Sub Private Sub Form_Load() 'Start the timer to run again in ??min Call StartCounter End Sub Private Sub Form_Timer() Dim Min As String Dim Sec As String Dim MilliSec As String Dim Msg As String Dim ElapsedMilliSec As Long StartCount = StartCount - 1 Min = StartCount \ 60 Sec = StartCount - (60 * Min) Me.lblCountDown.Caption = "Next Table Update " & Min & ":" & Format(Sec, "00") If StartCount <= 0 Then 'Do my stuff I need to do*********************** StartCount = 600 '10 Minutes in seconds End If End Sub