Auto Populate date on an Access form

C

cazzi

Hi,
I created an access form & would like a certain field to autopopulate
today's date when a new record is created. I tried placing =Now() in the
default value field under table properties that the form is linked to, but it
didint' work.

Please help!

Thanks,
 
J

Jeff Boyce

That depends on what you mean by "autopopulate"...

If you want to have every NEW record added to the table have a default value
of Now() (date PLUS time), what you did should work.

If you want to have every EXISTING record modified to include a date/time
value, you'll need to use an update query (or enter the correct values
yourself).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

Hi,
I created an access form & would like a certain field to autopopulate
today's date when a new record is created. I tried placing =Now() in the
default value field under table properties that the form is linked to, but it
didint' work.

Please help!

Thanks,

For one thing, Now() does not return today's date; it returns the date and
time, accurate to milliseconds. You might want Date() instead if you just want
a date.

In what way did it not work? setting the default value should work either in
the table field or in the DefaultValue property of a bound control on your
form; as soon as the record is dirtied by entering anything into any other
field the default value should be invoked. What are you doing, and what is or
isn't happening?
 
C

cazzi

Thanks for your help- I actually don't need to backtrack on any old data
since it's a new form. I tried it again using Date() & it worked.

Thanks,
 

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