i got a value as for example 01:34:32 (hh:mm:ss). Wich is the best and easiest way to count down this to 00:00:00,
and then put my code. i want to display the time in a label.
Printable View
i got a value as for example 01:34:32 (hh:mm:ss). Wich is the best and easiest way to count down this to 00:00:00,
and then put my code. i want to display the time in a label.
just count up and use dateadd/datediff :
Dim x As Date
Dim y As Date
Private Sub command1_click()
x = Now()
Debug.Print TimeSerial(0, 0, DateDiff("s", y, x))
End Sub
Private Sub Form_Load()
y = DateAdd("h", 1, Now())
End Sub
Code:Dim tTime As Date
Private Sub Form_Load()
Timer1.Interval = 1000
tTime = Now
End Sub
Private Sub Timer1_Timer()
tTime = DateAdd("s", -1, tTime)
Label1.Caption = Format(tTime, "hh:mm:ss")
End Sub
Thanks both!!!! It worked well. me.so glad.