I have a form that has a very simple progress bar. How do I add a timer that
shows the elapsed time aslo?
Add an unbound control to the form.
Name it "txtElapsedTime"
Leve gthe control's Format property blank.
Then set the Form's Timer Interval to 1000
Here is the code to make it work:
Option Compare Database
Option Explicit
Dim TheClock As Date
Private Sub Form_Load()
TheClock = Time()
End Sub
Private Sub Form_Timer()
txtTimeElapsed = DateDiff("S", TheClock, Time()) \ 60 & ":" &
Format(DateDiff("s", TheClock, Time()) Mod 60, "00")
End Sub
Whatch for word wrap above.
The above will count the minutes and seconds since the loading of the
form, i.e. 0:05, 0:16, 1:56, etc.