stopwatch or timer

ATB

Registered User.
Local time
Today, 11:24
Joined
Dec 7, 2000
Messages
30
I would like to add and timer to a form thats starts a timer at the click of a button and stops at the click of another button. like a stop watch, any idea's please.

thanks
 
Just off the top of my head you could use the "Time" function.
E.g. If you want to record time you could use a start variable & a stop variable.
In VBA, when you wish to begin recording you just assign the start variable = Time
The when you are finished assign the stop variable = Time

Stop - Start = Time elapsed.

Hope this helps.
 
If you are just wishing to time seconds, you could put this behind your form:

PHP:
Option Compare Database
Option Explicit

Dim intIndex As Integer

Private Sub cmdStart_Click()
    Me.TimerInterval = 1000
End Sub

Private Sub cmdStop_Click()
    Me.TimerInterval = 0
    MsgBox intIndex
    intIndex = 0
End Sub

Private Sub Form_Timer()
    intIndex = intIndex + 1
End Sub
 
Here's an example of a timer (in A2K) that I put together for time keeping on Teleconferences that I have weekly.
 

Attachments

Users who are viewing this thread

Back
Top Bottom