Hi all,
I would like to put a timer object on a form with start and stop buttons.
so I can see how much time has elapsed.
Any ideas?
TIA,
Tom
If that's all you wish to do you don't need to use the timer. Nor do
you need 2 command buttons.
Add a text control. Name this one "StartTime"
Add another control. Name this one "EndTime"
Add another control. Name this "Elapsed"
Add one command button. Caption = "Start"
Code it's click event:
If Me!CommandName.Caption = "Start" Then
Me![StartTime] = ""
Me![EndTime] = ""
StartTime = Time
Me![CommandName].Caption = "Stop"
Else
[EndTime] = Time
[Elapsed] = DateDiff("s", [StartTime], [EndTime])
Me![CommandName].Caption = "Start"
End If
The difference, in seconds, between the StartTime and EndTime will
display in the Elapsed control.