Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating time on form

Status
Not open for further replies.

unforgiven

Technical User
Dec 27, 2002
7
US
I'm trying to figure out how to update the current time date on a main form. I'm using NOW() to display it but the time is when the form is opened. I need somthing like while form showing update. Just not sure it would be. thaks for your help!
 
How are ya unforgiven . . . . .

If I read you correctly, Have a look at the [blue]On Timer[/blue] & [blue]Timer Interval[/blue] properties.

Calvin.gif
See Ya! . . . . . .
 
Unforgiven,

Here's a routine that I've used for a while that displays the date and time contiuously.

This assures that they will appear when the form first opens up, while the Timer is cranking up:

Private Sub Form_Open(Cancel As Integer)
Me("txtOmega") = Right$(Now, 11) 'Time display
Me("txtDayRunner") = Date 'Date display
End Sub

Then to make it update continuously:

Private Sub Form_Timer()
Me("txtOmega") = Right$(Now, 11) 'Time display
Me("txtDayRunner") = Date 'Date display
End Sub

The default interval works fine, so you don't have to set the interval.

Hope this helps!

The Missinglinq

"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top