Here's the routine I use to accomplish this. In this example, txtOmega takes the place of your text2. In order to have the time continuously updated, you have to use the Form Timer. Each time it clicks over the time is re-written and thus updated.
First, so that the time will be displayed for the initial period while the form and timer are "firing up", I put this in the Sub Form_Open.
Private Sub Form_Open(Cancel As Integer)
Me("txtOmega") = Right$(Now, 11) 'So that Time display
is visible while
waiting for timer
to crank up
End Sub
Then the following sub:
Private Sub Form_Timer()
Me("txtOmega") = Right$(Now, 11) 'Continuously updates
the Time display
End Sub
This gives the time in hours-minutes-seconds, with the seconds continuously ticking over. BTW, the Control Source is left blank. All the work is done in the VBA code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.