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?
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?
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
Thanks a lot guys