By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 2,208 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Clock on Form

P: 64
Good morning.

Is there a way to put a clock on a form? I know you can add a unbound box with default set to now() which gives you a date stamp when the form opens. How do put a clock on a from that keeps the date and time current?

-Tom
Dec 12 '07 #1
Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,616
I've never had a requirement to do this, but if I had I would firstly look in "MoreControls" in the Toolbox for a predefined clock object when designing a form (I had a quick look and saw nothing). After that, google for one and, if that fails, consider a simple Label control set to Now() but using the Timer Interval & On Timer properties to invoke code to keep it updated.
Dec 12 '07 #2

NeoPa
Expert Mod 15k+
P: 31,616
If variables are required then you can open the SQL as a recordset and process through it normally. An example of this sort of thing at work can be found in Basic DAO recordset loop using two recordsets.
Dec 12 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
[font=Shruti]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 forms property box. Under the Event Tab find Timer Interval and enter 1000.

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Form_Open(Cancel As Integer)
  2.   'Displays while waiting for timer to crank up
  3.   Me.txtOmega = Time 
  4. End Sub
  5.  
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.  Me.txtOmega = Time 'Display time
  3.  Me.txtDayRunner = Date 'Display date
  4. End Sub
  5.  
And before some says something about Windows already having a clock displayed in the taskbar (and somebody usually does) I run all my apps "full screen mode" as it were, where the Windows clock isn't visible.

Linq ;0)>
Dec 12 '07 #4

P: 64
[font=Shruti]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 forms property box. Under the Event Tab find Timer Interval and enter 1000.

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Form_Open(Cancel As Integer)
  2.   'Displays while waiting for timer to crank up
  3.   Me.txtOmega = Time 
  4. End Sub
  5.  
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.  Me.txtOmega = Time 'Display time
  3.  Me.txtDayRunner = Date 'Display date
  4. End Sub
  5.  
And before some says something about Windows already having a clock displayed in the taskbar (and somebody usually does) I run all my apps "full screen mode" as it were, where the Windows clock isn't visible.

Linq ;0)>

Perfect! Just what I was looking for.

Thanks

-Tom
Dec 12 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Dec 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.