Automatically Input Date

L

Linda

Hi,

I need to be able to have Access 2000 automatically input Date only when it
is a new record. How would I do this?
If the user is editing an old record and saving it, I do not want the date
to change to the current date.

Thanks
Linda
 
J

Jeff Boyce

Linda

Add a Default property of "Date()" (to get today's date) or "Now()" (to get
the current date/time) to the control that binds to the field in your table
that records the date of the new record.

Note: "Date" is a reserved word in Access -- use a different name for the
field.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
F

Fred Boer

Hi Linda:

Assuming you are using a form, in the On Current event for the form, put
code like this:

If Me.NewRecord Then
Me.DateField = Date
End If

HTH
Fred
 
F

Fred Boer

Hi Linda:

"Me." is a shorthand way to refer to the current active object, in this case
presumably the form. So "me" = "the form", and "DateField" = "the name of
the control that holds the value for the date".

But, really, Jeff's answer is better - is it showing up in your newsreader?
In case it isn't I repeat it here for you:

/Quoting a smarter man than me.. ;)

Add a Default property of "Date()" (to get today's date) or "Now()" (to get
the current date/time) to the control that binds to the field in your table
that records the date of the new record.

Note: "Date" is a reserved word in Access -- use a different name for the
field.

/End Quote

Cheers!

Fred
 
L

Linda

Thanks for the info!
Yes i have the response from Jeff and i'm actually testing it.

Thanks again
Linda
 
Top