I have a table with several time records. When I click on one of these records a form with a timer appears to continue counting the time. However the timer resets the time and starts from zero.
How do I stop the timer from continuing to count the time?
bntStart = button start timer
bntPause = button pause timer
label1 = Time textbox
Private Sub bntStart_Click()
Start_timer:
dteStart = Time
boolStopPressed = False
boolResetPressed = False
Timer_Loop:
DoEvents
dteFinish = Time
dteElapsed = dteFinish - dteStart + dteStopped
If Not boolStopPressed = True Then
label1 = dteElapsed
If boolResetPressed = True Then GoTo Start_timer
GoTo Timer_Loop
Else
Exit Sub
End If
End Sub
Private Sub bntStop_Click()
boolStopPressed = True
dteStopped = dteElapsed
End Sub
Bookmarks