Solved

How do you keep time ticking on a form?

Posted on 2004-09-14
5
173 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
ID: 12058068
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
ID: 12058320
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
ID: 12058347
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
ID: 12059411
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
ID: 12059446
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

832 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