Set Time Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to track the time on a record. I created a Click Macro to Set Time()
in a Text Box on my Form. It displays the current time but I get stuck on
that record? I can not move off of that record with out hitting the escape
key. I tried Stop Macro but no luck.
 
Problem is you have to keep running the macro constantly for the time to
change. You need to do this in VBA if you want it to work. Here's a hack I
use. In Design View for your form:

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.

In the Visual Basic Editor (code behind your form)

Private Sub Form_Open(Cancel As Integer)
'Displays while waiting for timer to crank up
Me.txtOmega = Time
End Sub

Private Sub Form_Timer()
Me.txtOmega = Time 'Display time
Me.txtDayRunner = Date 'Display date
End Sub

Omit the references to txtDayRunner in the Sub Form_Timer if you don't set up
a box for the date.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top