Default value of a field

  • Thread starter Thread starter William
  • Start date Start date
W

William

I have a field "Date" in a table and would like for the Default Value of this
field to be the current date for a new entry.
In the default value I have tried putting in Today() and =Today() as well as
Now() and =Now(). None have worked.
How can I accomplish what I am trying to do.
ACCESS 2007
Thanks!!!!!
 
I just tried using date() as a default value and it worked fine - that's the
function you'd want to use if you just want the date (Now() gives date and
time). The only thing I can think of is that your tables are linked and
you're trying to set the default from the front end rather than from the back
end DB. Also, you should not name the field Date, since that is an Access
function name!
 
Thanks Jim. I just changed the field name from "Date" to "DT." I just tried
again to put in Date() as a default value. I get the error message: "compile
error. in table validation expression." Thanks again.
 
Thanks Jim. I just changed the field name from "Date" to "DT." I just tried
again to put in Date() as a default value. I get the error message: "compile
error. in table validation expression." Thanks again.

That certainly sounds like... you have a compile error in the table validation
expression, which is a different property than the default value.

Open the table in design view, view its Properties - what if anything is in
the table validation rule?
 
Although you probably do need to figure out what is causing the error
messge, another way to get around setting the default value of the field is
to set the default value of the control that it is bound to.

Just an idea.

Dale
 
Hello John,

Thanks for you help. There was nothing in the Validation Rule. But today I
opened up Access, put in Date() again, and it looks like it is working fine.
I don't know what I could have been doing wrong yesterday. Thanks for your
help!!!
 
Hello Dale,
Thanks for you help. Today I opened up Access, put in Date() again, and it
looks like it is working fine. I don't know what I could have been doing
wrong yesterday. Thanks for your help!!!
 
Hello Jim,
Thanks for you help. Today I opened up Access, put in Date() again, and it
looks like it is working fine. I don't know what I could have been doing
wrong yesterday. Thanks for your help!!!
 
Back
Top