Calculating age over 100 years

StephenB

Registered User.
Local time
Today, 15:44
Joined
Apr 18, 2002
Messages
101
I have the following on a form:

Private Sub DOB_Exit(Cancel As Integer)
[Age] = ((Date) - [DOB])
End Sub

DOB (date of birht) is a field on a table. Age is an unbound field. This correctly returns the age when I enter a DOB that should return 99 years old or less. But when I enter a DOB that should return 100 years old or more, the age resets to zero.

Any suggestions on how I can correct this?
 
Assuming that DOB is a date/time field, the calculation as shown correctly returns the age in days. Is that what you want? If not, use the DateDiff() function or divide by 365 to get the age in years. Search this site or the Microsoft knowledge base for more DOB calculations.
 
Thank you Pat.
 
Thanks, Pat, (Again).

I had tried **many** of the recommendations that they suggested. Nothing was working. Turns out I had a format on the age field. Duh.

Glad your here.

Stephen
 

Users who are viewing this thread

Back
Top Bottom