static date

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

Guest

I want to have a date field default to the current date when a record is first entered, (field name: CreateDate) but I do not want the date to change from that point on (a constant or static date). In another field (EditDate) I want to set the default to update to the then-current date each time the record is edited. What functions should I use?
 
For the creation date, set the Default value for that
field to Date(). Since it is a default value, it will
only be set once when the record is first added if there
is no value in the field.

For the Edit date, you will need to add code to the
BeforeUpdate event of the form to set the EditDate field
to Date(). j.
-----Original Message-----
I want to have a date field default to the current date
when a record is first entered, (field name: CreateDate)
but I do not want the date to change from that point on
(a constant or static date). In another field (EditDate)
I want to set the default to update to the then-current
date each time the record is edited. What functions
should I use?
 
For the CreateDate field, set it's default value in your table to =Date()

For the EditDate, you'll have to do this in all forms that could change the
record.

Include the EditDate in the recordsource for the form (it doesn't have to
actually be on the form).

In the BeforeUpdate event for your form put
Me!EditDate = Date()

--
Joan Wild
Microsoft Access MVP

NancyN said:
I want to have a date field default to the current date when a record is
first entered, (field name: CreateDate) but I do not want the date to change
from that point on (a constant or static date). In another field (EditDate)
I want to set the default to update to the then-current date each time the
record is edited. What functions should I use?
 
Back
Top