Microsoft Access does not include a function that will calculate the age of a person or thing based on a given date
. This topic contains Microsoft Visual Basic for Applications (VBA) code for two custom functions, Age and AgeMonths, that will calculate age based on a given date.
The following function calculates age in years from a given date to today's date.
Function Age (varBirthDate As Variant) As Integer
Dim varAge As Variant
If IsNull(varBirthdate) then Age = 0: Exit Function
varAge = DateDiff("yyyy", varBirthDate, Now)
If Date < DateSerial(Year(Now), Month(varBirthDate), _
varAge = varAge - 1
Age = CInt(varAge)