Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How do you keep time ticking on a form?

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

I have the following code on my form.


Is there a VB that will keep the time ticking?
Question by:tachiinii
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 41

Expert Comment

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:


That should do it.

Author Comment

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)


End Sub
LVL 41

Expert Comment

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:

That should do it.

Author Comment

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?  
LVL 41

Accepted Solution

shanesuebsahakarn earned 2000 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.

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

610 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