By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,560 Members | 1,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,560 IT Pros & Developers. It's quick & easy.

Overriding a Date/Time stamp, and then Resetting it

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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
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.