How can I set a form to retain a date entered by the user?

O

OSEAcompguy

In Access (MS Office 2000), How can I set-up a form so that the Field is
initially blank, but for successive record entries, it retains whatever date
the user first inputted?
 
D

Douglas J. Steele

Set the field's Default Value to Date(). If you want both date and time, set
it to Now()
 
O

OSEAcompguy

But what if I want an earlier date?

Example: Accountant enters info. in form using an older date. Adds the
record then moves on to the next record, but wants to retain the older date
they entered in the first record.

However, I would like the form to initialize without any date.

Wouldn't "Date()" just provide the current date?
 
J

Jeff Boyce

Without some idea of how your underlying data is being displayed/expressed
in your form, this may not apply...

If, after updating (saving) the data from one record, you'll be wanting all
subsequent records to use the date from the first one, you'd have to modify
the Default property of that control on that form.

Good luck

Jeff Boyce
<Access MVP>
 
D

Douglas J Steele

The Default Property sets a value in a new textbox, but you can overwrite
it, so that in your scenario, the accountant would simply key in whatever
date he/she wants if it's not the current date.
 
O

OSEAcompguy

Yes. I understand that. What I'm looking for, though, is for the accountant
to only key in the arbitrary date once... and have it carry over in the form
for successive record entry... during that entry session only. Closing the
form and re-opening would either set the default to blank or current date,
thus forcing the user to re-enter the date.... but only once during a session.
 
D

Douglas J. Steele

Oh, sorry, that wasn't how I read "for successive record entries, it retains
whatever date the user first inputted".

Once a value has been entered, you can set the control's Default Value to
whatever it is that was entered. The "trick" is that the default property
has to be a string, even for dates and numeric values. Use the Format
function to ensure that the date's transformed into a string.
 
Top