Calculated age field not populating after 1/1/09

G

G.

I have a form with 3 subforms. On the form I have a "Date of Birth" field
that is manually populated and then I have an "Age" field that calculates the
age. The formula for the Age field is =Int((Date()-[birthdate])/365.25) and
it works fine on the form - The Age field is populated on all of the records
in the form. All 3 subforms have an "Entry Date" field that is manually
populated with the date that the particular record was entered. When I go to
the table or try to create a query and select the Age field as one of the
fields in the query, some of the ages are missing - the field is blank. In my
quest to figure out what is happening I managed to narrow it down and saw
that all of the Age fields in any record entered on or after 1/1/09 are
blank, whereas the others are all there (again, the Age field IS populated in
the form itself though, it is just not getting to the table). Please help.

thank you,
G.
 
D

Daryl S

check to make sure the Age field on the form is bound to the corresponding
field in the database. Also, when does the age get calculated? The age
needs to be calculated before the record is saved.
 
K

KenSheridan via AccessMonster.com

Your expression is not an accurate way of computing age; it would fail with
someone with a first birthday today (16 September) for instance. Instead use
one of the methods from:

http://www.mvps.org/access/datetime/date0001.htm

Also, do not include an age column in the table, but compute the current age
using one of the methods from the above link whenever required, either in a
computed column in a query or a computed control in a form or report. If you
want to return the age of a person at the date when the row was inserted into
the table you can do so by passing the values of the Entry Date and Birthdate
columns into one of the functions.

Ken Sheridan
Stafford, England

G. said:
I have a form with 3 subforms. On the form I have a "Date of Birth" field
that is manually populated and then I have an "Age" field that calculates the
age. The formula for the Age field is =Int((Date()-[birthdate])/365.25) and
it works fine on the form - The Age field is populated on all of the records
in the form. All 3 subforms have an "Entry Date" field that is manually
populated with the date that the particular record was entered. When I go to
the table or try to create a query and select the Age field as one of the
fields in the query, some of the ages are missing - the field is blank. In my
quest to figure out what is happening I managed to narrow it down and saw
that all of the Age fields in any record entered on or after 1/1/09 are
blank, whereas the others are all there (again, the Age field IS populated in
the form itself though, it is just not getting to the table). Please help.

thank you,
G.
 

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

Similar Threads


Top