Hello all!! i have created a very nice s/b and i want to add a clocck in it. I've tried the same way as in forms (label, adding the code in the form etc.) but it didnt work. Can anyone specify the exact code i have to enter? thanks in advance!
Here's a thing I use. You'll need a textbox called txtOmega (yeah, I'm a watch fanatic) and you'll maybe want to add some cosmetics to it, like a frame around it. If you'd also like to show the date, add a textbox called txtDayRunner.
Goto your form’s property box. Under the Event Tab find Timer Interval and enter 1000.
Code:
Private Sub Form_Open(Cancel As Integer)
'Displays while waiting for timer to crank up
Me.txtOmega = Time
Me.txtDayRunner = Date
End Sub
Private Sub Form_Timer()
Me.txtOmega = Time 'Display time
Me.txtDayRunner = Date 'Display date
End Sub
There is a simle way to do this in access for those who want to simply do this.
Open the form or report in design
On the Insert menu, click Date And Time.
To include a date, select the Include Date check box, and then click a date format.
To include the time, select the Include Time check box, and then click a time format.
The only problem is the clock won't automatically update for you but all it is is 2 text boxes one with =Date() as a control souce the other as =Time()
This isn't as good as other ways since it isn't real time but just thought to point it out for less experienced users
A clock usually means something that displays the current time, which your method doesn't. Why would you add to an almost two year old thread with an irrelevant post?