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

Clock on a Form ? 3

Status
Not open for further replies.
Oct 23, 2002
57
US
I have searched and tried the examples I found here but I cannot seem to work out the trick of placing a clock on a form, that updates itself every second (I'd prefer every minute). Most examples use a lable to do this but I haven't figured that method out. Could someone spell it out for me ?
 
Place a textbox (ClockBox) on the form
Set TimerInterval property of the form to 60000 (60 seconds)

Sub Form_Timer()
Me("ClockBox") = Now
End Sub

That's it...

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Daniel,

I must be missing something here. I placed a textbox on the form and named it ClockBox. On the form itself I set the TimerInterval Property to 60000. In the vbe for the forms code I placed the sub procedure Form_Timer(). After saving and getting out of design view the text box is blank... What did I miss or mess up ?
 
I don't know what happened but I went ahead and did some other work on the Db and now the Clock function is working.

I am stumped, well anyway what is the correct formating to show only hours, minutes and am/pm ? (no seconds).
 
Another question if you please...

I think it is called a status bar ( the bottom part of the access window that displays such things a design view, form view...) With every tick of the clock I see it saying form view then calculating then back to form view - is there any way to stop it from displaying this message ?


Anyway thanks a bunch Dan, a star for you. By the looks of things two others gave you a star.

 
Me("ClockBox")=Format(Now, "hh:nn ampm")
or format the textbox to Medium Time

As for the status bar, you could try:

DoCmd.Echo False,"WhateverTextInTheStatusBar"
Me("ClockBox")=Format(Now, "hh:nn ampm")
DoCmd.Echo True, "WhateverTextInTheStatusBar"

Not tested, but in theory it should work...

Don't forget to set Echo to True, otherwise you'll get the impression that the program has frozen...

Thanks for the stars, looks like a shiny night [lol]

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Thanks for your assistance it is appreciated greatly. My only bug with the clock is that it takes a minute and a half before it shows up in the text box and starts working. Other than that I am quite happy with what you gave me. Here's another star for the status bar post :}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top