Enter Date Once

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

Guest

Is it possible for my user to open a form and enter a date only once. My user
will be entering a lot of records with the same date, but it won't
necessarily be the current date. May be past dates involved. I would like for
my user to only have to enter the date once even though she is creating new
records.

Thanks.
 
Please search for an answer before you post a new thread. This is a pretty
common question. As previously posted, the following links might help
you...

Use the AfterUpdate event of the control to set its Default Value.

Details:

http://www.mvps.org/access/forms/frm0012.htm



An alternative approach is to use the BeforeInsert event of the form to copy
the values from the last record:
 
Sherry,

The cleanest way to do this is to set the default value in the field's
AfterUpdate event procedure:

Me!MyTextbox.DefaultValue = Me!MyTextbox

Occasionally, if it's going to be many records between a change of date,
I'll disable the textbox also, so that the user does not need to Tab out of
the field:

Me!MyTextbox.DefaultValue = Me!MyTextbox
Me!MyTextbox.Enabled = False

Then I provide a command button on the form to allow the user to enter a new
value:

Me!MyTextbox.Enabled = True
Me!MyTextbox.SetFocus

Hope that helps.
Sprinks
 
Hi Sprinks,
Thanks for your help. However I entered the code in the AfterUpdate event
and when I go to the next record I get 12/30/1899 12:00:53 AM in the textbox.
I set the format to ShortDate in the form and the table and that did not help.

Thanks,
 
Thanks this worked. I searched, but I was searched for specifice help with
dates. That's why I didn't find this. Thanks for enlightening me about being
more specific when searching.

I could search again, but since we're on the subject, is there a way to do
this and make the value stay even if they close the form? For instance they
will have entries daily and they also provide a week ending date which I
would like for them to enter on Monday and not have to enter that date for
the rest of the week.

Thanks,
 
Ok, I figured this out. I had my form set to data entry and open in add mode.
I changed data entry to no, changed open add mode to edit and sort descending
by date and this works out woderfully.

Thanks again for all of your help! :o)
 
Back
Top