Add Timer control, label (I named it lblTime) and use code below - it will calculate ellapsed seconds and show formated value (hh:nn:ss) in the label:
Code:Option Explicit Dim strStartTime As String Private Sub Form_Load() strStartTime = Now lblTime.Caption = "00:00:00" Timer1.Interval = 1000 '1 second Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Dim lSecondsEllapsed As Long lSecondsEllapsed = DateDiff("s", strStartTime, Now) lblTime.Caption = Format(lSecondsEllapsed \ 3600, "00") & ":" & _ Format((lSecondsEllapsed \ 60) Mod 60, "00") & ":" & _ Format(lSecondsEllapsed Mod 60, "00") End Sub




Reply With Quote