Hi,
The way I do this is to create a text box on a form, and then make the source of the form "=Age()"
This refers to a function that I put in a module.
There is no reason to store this info in the database since it is always changing. Just have it displayed on a form or report when you need it.
Here is the function code.
'=====
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), Day(varBirthDate)) Then
varAge = varAge - 1
End If
Age = CInt(varAge)
End Function
'=====
HTH
mmcdonal
|