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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date on form auto update

Status
Not open for further replies.

ocan

Programmer
Jun 28, 2004
31
US
I have a main menu in a program & in the control source for a text box is

=Format(Now(),"dddd"", ""mmm d yyyy"", ""hh:nn:ss ampm")

but it only keeps the day/time for when the form is opened. how could i keep it synchronized with the computer clock.

thanks.
 
If you are after a clock on your form


Put this code in your form's ON LOAD event:

Me!lblClock.Caption = Format(Now, "dddd, mmm d, yyyy, hh:mm:ss AMPM")
Me.TimerInterval = 1000

Put this code in the TIMER INTERVAL event:

Me!lblClock.Caption = Format(Now, "dddd, mmm d, yyyy, hh:mm:ss AMPM")


Then, but a label on the form called "lblClock" (without the quotes) and you're done.

Borrowed from someone


Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top