Perpetual Clock??!?

Lochdanon

Registered User.
Local time
Today, 16:14
Joined
May 7, 2003
Messages
21
Is it possible to have a Current Time Textbox that acts like a clock (ie. updates the time continually!)
 
Add a textbox-call it txtTime. Set
Enabled to No, Locked to Yes
Set the Forms timer interval to 1000(1 second to us)
Add this code to the forms timer event.

Me.txtTime = Now()
 
Fornatian said:
Add a textbox-call it txtTime. Set
Enabled to No, Locked to Yes
Set the Forms timer interval to 1000(1 second to us)
Add this code to the forms timer event.

Me.txtTime = Now()

That's kinda cool but my question for Lochdanon is why do you need to put a clock in a form?
 
The reason is to time stamp data that is entered into the database. Its for a operational downtime reporting system.

Thanks for the help
 
Yeah, don't use a clock for this; you'd be using unnecessary resources. Just add a field to the underlying table and then put a disabled text box on your form. In code:

Private Sub Form_Dirty(Cancel as Integer)
Me.YourDateTimeTxtBox=Now()
End Sub

This will stamp the date and time for this record as soon as it begins to be entered.
 
Okay, that sounds like a good idea ... I'll give that a try to.
 
Yeah, I agree. i was stepping back to my marketing days of give the customer what they want, not what you think they want.
 
Check that though; use the OnDirty event when you want a stamp of when a record was updated. Use AfterInsert to stamp its original input.
 
Everyone,

You are all overlooking the most obvious of answers to TimeStamp a record. Make the default value of the field that holds this value =Now().

Do not show this field on the entry form (or disable/lock) the field to prevent tweaking.


(of course this only works on the Insert of a new record)
 
Date stamp in the BeforeUpdate() event of a record.
 
I might have the wrong end of the stick again but if it's for calculating form downtime then surely you need to check the actual time against the time the form was last used in terms of key presses and clicks at set intervals whether that be seconds,minutes etc...?

Travis, won't your method return only the time the record was started and not the time the record was changed.
 
Hi guys,

All ways suggested worked fine ... the for this is that the downtime is calculated from the time the the information is sent to the output table, but the data will be sent out only when downtime occurs and this clock will be perfect. As each record is set in the output table it is stamped by the subform which is grabbing the time date etc.... each time it has data entered.

Thanks for all the input, you guys are an invaluable resource for the beginner Access programmer.

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom