Hi everyone
trying to write a program to calculate and dispaly on a msgbox the age of an input birthdate and the current date. Tried this code below but not giving correct age.


StudentDate = cboDate.Text & "/" & cboMonth.Text & "/" lblYear.Caption
StudentAge = DateDiff("yyyy", StudentDate, Now())
If Month(Now) < cboMonth.Text Then
StudentAge = StudentAge -1
ElseIf Month(Now) = cboMonth.Text Then
If Day(Now) < cboDate.Text Then
StudentAge = StudentAge -1
End If
End If

This code makes the age correct if month is after the current month, but any date before the current month is a year out.

Thanks Tink