Can`t get DateDiff to work...
Hi,
I have a button on my form.
When I press the button, I want a timer/clock to start.
When I press the button again, I want the timer/clock to stop and I wan`t the time that has elapsed to appear on the screen.
Iam finding difficulties at the moment with DateDiff.
Can anyone give me any info on how i can do this?
Thanks
Mark
Re: Can`t get DateDiff to work...
One command button and one text box
Option Explicit
Dim starttime As Date
Dim endtime As Date
Private Sub Command1_Click()
If Command1.Caption = "Stop" Then
endtime = Now
Text1 = DateDiff("s", starttime, endtime)
Exit Sub
End If
starttime = Now
Command1.Caption = "Stop"
End Sub
David Paulson