I have found the code to convert date of birth to years on the forum:
Private Sub DateofBirth_BeforeUpdate(Cancel As Integer)
If Date >= DateSerial(Year(Date), Month(Me![DateofBirth]), Day(Me![DateofBirth])) Then
Me![age] = DateDiff("yyyy", Me![DateofBirth], Date)
Else
Me![age] = DateDiff("yyyy", Me![DateofBirth], Date) - 1
End If
End Sub
I would like to display the result to show years, months and days
i.e 10 years 7 months 17 days
Any suggestions as to how to do this?
Private Sub DateofBirth_BeforeUpdate(Cancel As Integer)
If Date >= DateSerial(Year(Date), Month(Me![DateofBirth]), Day(Me![DateofBirth])) Then
Me![age] = DateDiff("yyyy", Me![DateofBirth], Date)
Else
Me![age] = DateDiff("yyyy", Me![DateofBirth], Date) - 1
End If
End Sub
I would like to display the result to show years, months and days
i.e 10 years 7 months 17 days
Any suggestions as to how to do this?