You can use a custom VBA function
Public Function fAge(dtmDOB, Optional dtmDate)
'Returns the Age in years, for dtmDOB.
'Age calculated as of dtmDate, or as of today if dtmDate is missing.
'If as of date not passed then set to today's date
If Not IsDate(dtmDate) Then dtmDate = Date
If IsDate(dtmDOB) Then 'If date passed, then calculate age
fAge = DateDiff("yyyy", dtmDOB, dtmDate) + _
(DateSerial(Year(dtmDate), Month(dtmDOB), Day(dtmDOB)) > dtmDate)
Else
fAge = Null
End If
End Function
OR one of the following expressions should be helpful
'Fails if DOB is null
Int(Format(Date(), "yyyy.mmdd") - Format([DOB], "yyyy.mmdd"))
'Returns Null if DOB is Null
DateDiff("yyyy",DOB,Date()) + Int(Format(DOB,"mmdd") > Format(Date(),"mmdd"))
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County