Hi,
I'm working on a timer project, but I can't figure out what is happening with my timer when I try to format it. My project works without formatting, but as soon as I format it, the timer stops counting, although the formatting is correct. My overall goal is to format the timer to Ss.
Thanks for any help!
Option Compare Database
Option Explicit
Dim StartTime As Date
Dim ElapsedTime As Date
Private Sub cmdReset_Click()
txtTimeOutput.Value = ":00"
Me.TimerInterval = 0
End Sub
Private Sub cmdStart_Click()
Me.TimerInterval = 1000 ' 1 second
StartTime = Time()
End Sub
Private Sub cmdStop_Click()
Me.TimerInterval = 0
'Me.txtTimeOutput.Value = ":00"
End Sub
Private Sub Form_Load()
Me.TimerInterval = 0
End Sub
Private Sub Form_Timer()
'txtTimeOutput.Value = DateDiff("s", StartTime, Time() )
txtTimeOutput.Value = Format(DateDiff("s", StartTime, Time()), "Ss")
End Sub