Time Change

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

Guest

I have a control in my form that is "currenttime".
This form is open ready for new data to input,
however, the time is stopped at the moment
I open the form.

Is there a way for the time to continue while the
form is open and then freeze when the control is
either "clicked" or a "button" is pushed, so the
correct time is recorded for that data that is
entered?

Thanks,
Tom
 
Tom,

Do you mean you want this field to record the time that the record is
completed/saved? It sounds like you have the Default Value of the field
set to Time(), am I right? If so, I would remove this, it is not what
you want. You can do this... On the Before Update event of the form,
put code like this...

Me.YourTimestamp = Time

However, what this means is that if the record is saved, and then
subsequently edited (and thus saved again), the Timestamp field will be
updated to the time of the update. If this is not what you want, and
just want to retain the time of the first entry of the record, then use
code like this...

If IsNull(Me.YourTimestamp) Then
Me.YourTimestamp = Time
End If

or...
If Me.NewRecord Then
Me.YourTimestamp = Time
End If
 

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

Similar Threads


Back
Top