Hi Berek ,
Since Age is a calculation (and will change), it is something that
should be shown on a form or report rather than stored. You can't use
equations like that in the DefaultValue property of a table, but you can
set a DefaultValue like this for a form control ... but, in this case,
you wouldn't do that because the equation should be preceeded by an
equal sign (=) and used as the ControlSource of a calculated control
You should not put data directly into tables anyway.
Also, the equation you are using won't work properly if the person was
born in December and the current month is July because Access will just
take the difference of the years.
This was posted by Ricky Hicks:
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the current age .. use:
DateDiff("yyyy", [DOBField], Date()) +
(Date() < DateSerial(Year(Date()), Month([DOBField]), Day([DOBField])))
"DOBField" should be the name of the field that contains the Date of
Birth value ...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Warm Regards,
Crystal
*

have an awesome day

*
MVP Access
I trying to determine the age of a person and I was using this command in the
default value:
DateDiff("yyyy",[birth_date],Date())
and when i try to save the table it says
"The database engine does not recognize either the field 'birth_date' in a
validation expression, or the default value in the table 'general'
I believe it is the latter situation, but not sure how to fix it
Thanks