PDA

View Full Version : Running Clock



Scooter172
08-23-2010, 12:01 PM
I would like to put a running timer on my switchboard page in the header to the right of the start page name. I want this clock to mimick the computer clock with a running second count if Possible. Sorry new to Access:help

Imdabaum
08-23-2010, 02:25 PM
Create a label on your form, I would call it lblClock or lblTime... something you fancy,

Then on the form properties, Set timer interval to 1, then On Timer event add the following code.


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

Scooter172
08-23-2010, 05:32 PM
I get an error, stating that it is not proper use of Me! statement

Imdabaum
08-23-2010, 09:47 PM
Then try Me.lblClock.Caption, see if that works for you.

The one thing I don't like about that is the refreshing seems to be very sporadic... meaning it ticks fine, but occassionaly your screen jumps all over the place.

Perhaps someone else has a better idea, but I haven't quite figured out how to fix both issues at the same time.

Scooter172
08-24-2010, 08:48 AM
4374

Here is a screen shot of how that ended up

Imdabaum
08-24-2010, 10:18 AM
Private Sub Form_Timer()
Me.lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
End Sub

Scooter172
08-30-2010, 11:13 AM
I have still not had luck making this work.. I have reset timer to 1 and then entered the code in the cell On Timer and I get nothing...Zip Zero Notta!!

Imdabaum
08-30-2010, 01:59 PM
I'm not sure what is going wrong.

Are your lables the same as what is being called in the Sub? Are you calling the On_Timer event from the Main form? Or are you trying to call it somewhere else? You mentioned you put the code in the cell... It shouldn't be in a cell. It should be bound to the form's timer. See if this file works any different.