I dont think you want to use a timer.
A timer is not a clock - it is a way of generating an event at regular intervals.
If you need to know seconds since something happened, just look at the NOW function, which returns the current time.
Example code follows: Create a form with a button and a textbox set to multi line.
When the form loads, it stores the time.
Every time you click the button, it will tell you the number of elapsed seconds since that point. You could use a timer to update a label with the current time...
<code>
Dim t_now As Date
Dim t_then As Date
Dim elapsed_seconds As Double
Private Sub Command1_Click()
t_now = Now
elapsed_seconds = (t_now - t_then) * 100000
'show the time
Text1.Text = Text1.Text & t_now & vbCrLf
Text1.Text = Text1.Text & "Elapsed seconds: " & _
Format(elapsed_seconds, "0.00") & vbCrLf
End Sub
Private Sub Form_Load()
t_then = Now
Text1.Text = ""
End Sub
</code>
Enter your message below
Sign in or Join us (it's free).