0

Hey, I faced one tiny problem, but I can't figure it out. What I need is basically "label1 = format(now, "hh:mm:ss")", but I want start counting time from zero: "00:00:00".. Any help?

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by akhileshbc
0

Capture start time into a variable and use datediff function to test the difference returning seconds mod 60 returns minutes mod 60 returns hours. Understand?

Good Luck

0

Use a Timer control in your form. Then write the below code:

Dim Start_Time As String


Private Sub Form_Load()
Start_Time = Time
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
Me.Caption = "Elapsed Time: " & Format(DateAdd("s", DateDiff("s", Start_Time, Time), "0:0:0"), "hh:mm:ss")
End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.