How accurate do you want to be? By your formula I am a year older than my actual age because my birthday has not happened this year yet.
to get an accurate age use a function
Code:
Public Function AgeYears(ByVal datBirthDate As Date) As Integer
' Comments: Returns the age in years
' Params : datBirthDate Date to check
' Returns : Number of years
' Source : Total Visual SourceBook
On Error GoTo Proc_Err
Dim intYears As Integer
intYears = Year(Now) - Year(datBirthDate)
If DateSerial(Year(Now), Month(datBirthDate), Day(datBirthDate)) > Now Then
' Subtract a year if birthday hasn't arrived this year
intYears = intYears - 1
End If
AgeYears = intYears
Proc_Exit:
Exit Function
Proc_Err:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , "modDateTime.AgeYears"
Resume Proc_Exit
End Function
To get the age at registration in years, assuming registration occurs after birth, use
Code:
datediff("yyyy",Birthdate,RegDate)