How do I default a text box in an Access page to the current date.

M

Mark

On the properties sheet, set the default value to "=Date()" without the
quotes. Each time a new record is created with the form, your text box will
be populated with the current date.
 
R

Ricardo Tonos

Set the defaul value to Now()

Mark said:
On the properties sheet, set the default value to "=Date()" without the
quotes. Each time a new record is created with the form, your text box will
be populated with the current date.
 
D

Douglas J Steele

Be aware, though, that Now includes both date and time.

While that's often what you want, it does mean that you will be unable to
simply query by date: you can't, for instance, do a SELECT * FROM MyTable
WHERE MyDateField = #08/24/2005# to get all of the records associated with
yesterday. (Of course, there's an easy workaround: SELECT * FROM MyTable
WHERE MyDateField Between #08/24/2005# And #08/25/2005#)
 
Top