"Date created" field on form

S

Susan

I want to place a field on a form which automatically
indicates the date on which a new record was
created/input. I want this date to be non-updatable and
unchangeable. I'm assuming there must be a field in the
table for this date, but how is it formatted so that the
date the record is input (saved) is the date that is
shown? Is this even possible?
 
G

George Nicholson

1) Create a Date/Time Field in your table. Call it "AddedOn" or whatever
2) Set "Required" to "Yes" and "DefaultValue" to "Now()"

From this point on whenever a new record is created the current Date/Time
will be automatically inserted into the field. If you already have records
in this table you will have to ignore the error messages you will get when
you save the table the first time. You can fill in the "missing" data
afterwards with an update query if you desire.

To make it non-updateable on the form: add the field to the form and then
set the control's Enabled property to False and/or the Locked property to
True.
 
S

Susan

Great! And thanks for the prompt response!
-----Original Message-----
1) Create a Date/Time Field in your table. Call it "AddedOn" or whatever
2) Set "Required" to "Yes" and "DefaultValue" to "Now()"

From this point on whenever a new record is created the current Date/Time
will be automatically inserted into the field. If you already have records
in this table you will have to ignore the error messages you will get when
you save the table the first time. You can fill in the "missing" data
afterwards with an update query if you desire.

To make it non-updateable on the form: add the field to the form and then
set the control's Enabled property to False and/or the Locked property to
True.

--
George Nicholson

Remove 'Junk' from return address.





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top