Solved

How do you keep time ticking on a form?

Posted on 2004-09-14
5
172 Views
Last Modified: 2010-08-05
How do you keep time ticking on a form?

I have the following code on my form.

=Time()


Is there a VB that will keep the time ticking?
0
Comment
Question by:tachiinii
  • 3
  • 2
5 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
Comment Utility
Change the box to unbound (remove the control source). Set the form's TimerInterval property to 1000 (which is 1 sec). Now, in the OnTimer event, put this:

Me!MyTextBox=Time()

That should do it.
0
 

Author Comment

by:tachiinii
Comment Utility
I'm having problems?

What would te code look like in steps?  THis is what I have so far:

Private Sub txtTime_BeforeUpdate(Cancel As Integer)

OnTimer

End Sub
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
Comment Utility
No, it doesn't go in the BeforeUpdate event.

Bring up the properties of the text box. Go to the Event page. Find the Timer Interval property. Change it to 1000. Now, on the same page, click in the OnTimer row. Click the build "..." button and choose Code Builder. Paste this between the Sub and End Sub lines:
Me!txtTime=Time()

That should do it.
0
 

Author Comment

by:tachiinii
Comment Utility
I'm in the events page of Proerties for the unbound text box and I don' see anything for the Timer Interval property?  
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 500 total points
Comment Utility
Both TimerInterval and Timer are form events, my mistake. Design your form and bring up the properties page. You should see them on there under the Event page, near the bottom.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now