How do I properly set up a Default Value?

T

tshahan

I am trying to set up the Default Value to DateAdd 180 days to a date located
in another field. I've been trying the expression:
DateAdd("d",180,[Closed])
and other similar to this, however it keeps kicking everything out. Anybody
know how to correct this?
 
D

Douglas J. Steele

You can't use a function based on another field's value as a default value.
 
J

Jeff Boyce

As Doug points out, a default based on another field won't work, mainly
because a default is a value BEFORE there's a record -- no record, no
"other" field.

Another point to consider -- if you are already recording a date, you don't
really need to store a calculated value based on that (and some very good
reason why not to!). Besides the extra data storage (insignificant cost
these days), and the problem of keeping data synchronized between the fields
(serious issue), it is MUCH faster to calculate the later date as part of a
query than to "look it up" on a hard drive.
 
T

Thanks

Thanks for your help!
Jeff Boyce said:
As Doug points out, a default based on another field won't work, mainly
because a default is a value BEFORE there's a record -- no record, no
"other" field.

Another point to consider -- if you are already recording a date, you don't
really need to store a calculated value based on that (and some very good
reason why not to!). Besides the extra data storage (insignificant cost
these days), and the problem of keeping data synchronized between the fields
(serious issue), it is MUCH faster to calculate the later date as part of a
query than to "look it up" on a hard drive.

--
Good luck

Jeff Boyce
<Access MVP>

tshahan said:
I am trying to set up the Default Value to DateAdd 180 days to a date located
in another field. I've been trying the expression:
DateAdd("d",180,[Closed])
and other similar to this, however it keeps kicking everything out. Anybody
know how to correct this?
 

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