T
Tina Hudson
Good day,
I want to prevent a future date being entered for a birth date, but I can't
get this to work. I suspect it has something to do with the MsgBox, but
don't know how to fix. Here is my code:
Private Sub DOB_AfterUpdate()
If ([DOB].Value) > Date Then
MsgBox "The date you entered is a date in the future. Please verify
date and try again. Press OK to continue.", vbExclamation + vbOKOnly,
"Invalid Birth Date"
Me![DOB].SetFocus
End If
End Sub
I want to prevent a future date being entered for a birth date, but I can't
get this to work. I suspect it has something to do with the MsgBox, but
don't know how to fix. Here is my code:
Private Sub DOB_AfterUpdate()
If ([DOB].Value) > Date Then
MsgBox "The date you entered is a date in the future. Please verify
date and try again. Press OK to continue.", vbExclamation + vbOKOnly,
"Invalid Birth Date"
Me![DOB].SetFocus
End If
End Sub