468,747 Members | 1,653 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,747 developers. It's quick & easy.

Overriding a Date/Time stamp, and then Resetting it

Hi - I am using a Date/Time Picker popup form for users to choose a a
date and time for use on a separate entry form. The date/time on the
entry form is actually entered automatically as a date/time stamp when
a user enters a record. So, the popup form is only necessary when a
user needs to change the date/time.

To make this more user-friendly...there will be times when a user will
be away from the computer, and therefore, will have to later enter a
bunch of back-dated records in one sitting. When a user picks an
older date/time from the picker, is there a way to temporarily store
that value and use it for all the new records he/she enters in that
sitting; while the entry form is open (single form view). Then, if
the user closes and reopens the form, or simply clicks a button
somewhere to reset the date/time, the date/time stamp would be reset
to the machine's current date/time.

I hope this makes sense.
Thank you.
Jun 27 '08 #1
1 1823
I'm posting a solution to my own problem--just one way I suppose...

In the subform that contains the date & time stamp field, I added an
unbound textbox named txtDate to store a separate, hidden date value
with the default value of Now(). If the user double-clicks on the
regular date/time field named InterventionDateTime and picks an
earlier date from the popup mini date/time picker, then this will
occur on the beforeupdate of the subform:

If Me.txtDate Me.InterventionDateTime Then
If MsgBox("Do you want to use this 'past' date as the" & Chr(13) +
Chr(10) _
& "default date for new interventions entered this session?", vbYesNo)
= vbYes Then
InterventionDateTime.DefaultValue = "#" & InterventionDateTime & "#"
Me.Parent.cmdResetDateTime.Visible = True
Else
InterventionDateTime.DefaultValue = "#" & Now() & "#"
End If
End If

On the main form, I added a cmdbutton named cmdResetDateTime that,
when clicked, will reset the date to "#" & Now() & "#".

Lastly, on the mainform's open event, I also reset the default value
of the subform's date field to "#" & Now() & "#".
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Don | last post: by
6 posts views Thread by Mike Charney | last post: by
5 posts views Thread by Des | last post: by
1 post views Thread by Susan Bricker | last post: by
16 posts views Thread by W. eWatson | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.