charliebcc
12-14-2001, 07:41 AM
I am using a data entry form where I have a Date of Birth field. How can I have the age appear in another box after the DOB is entered?
|
View Full Version : Date Of Birth charliebcc 12-14-2001, 07:41 AM I am using a data entry form where I have a Date of Birth field. How can I have the age appear in another box after the DOB is entered? Jack Cowley 12-14-2001, 07:44 AM Age = DateDiff("yyyy", [Bdate], Now())+ Int( Format(now(), "mmdd") < Format( [Bdate], "mmdd") ) Change the Bdate field to the name of your DOB field and put this in the After Update event of the DOB field. Set Age to the correct name of your age field. [This message has been edited by Jack Cowley (edited 12-14-2001).] charliebcc 12-14-2001, 08:14 AM Thanks very much for the quick response. This works fine until I enter a date that is lower then 1930. This will be used in an ambulance squad for patients and there will be patients under that date. When I enter any date below 1930 I get a -number. ie: 3/11/29 gives me -28 while 3/11/30 returns the correct age 71. Please help. Jack Cowley 12-14-2001, 08:40 AM Use the full year i.e. 1/12/1923 charliebcc 12-14-2001, 09:03 AM Works just fine, Jack. Thank you. |