Automatically populate current system date in Access table

  • Thread starter Thread starter Guest
  • Start date Start date
ElaneJ said:
How can I automatically populate current system date in an Access
(.mdb) table?

Set the value to NOW() sets the date and time to now. There are a
number of ways to set it, when do you want it set; when created, when
edited, when viewed ...?
 
When you create the record, when you update the record, or when you read it?

To do it when you create the record, you can set the default value of the
table's field to Date() (or Now() if you want both date and time).

To do it when you update a record, you must use a form. In the form's
BeforeUpdate event, put code to set the field to Date() (or Now())

To do it when you read the record, you'd need to put the logic in the form's
Current event.
 
How can I automatically populate current system date in an Access (.mdb) table?

Just set the DefaultValue property of a date/time field in the table
to Date(). When you create a new record in the table it will fill in
the current date.

John W. Vinson[MVP]
 
I can not make query by date with Query design. IN criteria I have written
e.g. 2.12.09 end It isn't go. Thanks!
 
2.12.09 isn't a date to Access. Dates must be delimited with # characters
and must be in a format Access recognizes (for the most part, Access doesn't
not respect regional settings in queries).

Assuming you mean 2 December, 2009 as the date, use #2009-12-02#
 
Back
Top