Need 'date added' column populated

D

David

I have a subform which is used to add or update records.
The table it updates has a 'created date' column. I need
to populate this column with the data/time the record gets
added. But I dont want this column updated when the record
is updated so I cant just make it a bound column. How to
do this? The column is not displayed on the form but I
could make it a hidden control if needed.
- David
 
S

SteveS

David said:
I have a subform which is used to add or update records.
The table it updates has a 'created date' column. I need
to populate this column with the data/time the record gets
added. But I dont want this column updated when the record
is updated so I cant just make it a bound column. How to
do this? The column is not displayed on the form but I
could make it a hidden control if needed.
- David

Try this:

In design view of the table, set the default value for the field
'Created Date" to Date(). Now every time a record is created, the date
is entered - no coding , no fuss, no worries about record updates.


FYI - spaces should be avoided in object names (ie fields, controls,
queries, forms, reports, etc). It is better (easier) to use
'CreatedDate' rather than 'Created Date' especially if you have to do
any coding.

HTH

Steve
 

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