![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have the following code that is used to determine a person's age as of the run date. I'm receiving an error message in my query related to this function "Invalid use of null." I checked the values in the field bdate, and they are all populated and are all less than (older) than the current date. Can't seem to figure out what's causing the error. Function yourAge(bdate) As Integer Dim DateToday As Variant DateToday = Date If Month(DateToday) < Month(bdate) Or (Month(DateToday) = _ Month(bdate) And Day(DateToday) < Day(bdate)) Then yourAge = Year(DateToday) - Year(bdate) - 1 Else yourAge = Year(DateToday) - Year(bdate) End If End Function |
![]() |
| Thread Tools | |
| Display Modes | |
| |