Hi
I have this code below, validating the date. so far it's just validating the date.
I'm accepting a data from the user and I want to throw error also when they put future date, be it on the month or a year, please help.
I have this code below, validating the date. so far it's just validating the date.
I'm accepting a data from the user and I want to throw error also when they put future date, be it on the month or a year, please help.
Code:
If (Mid(mskEffDate.Text, 1, 4) >= "1900" And _
Mid(mskEffDate.Text, 1, 4) <= "2100") Then
If (Mid(mskEffDate.Text, 5, 2) < "13" And _
Mid(mskEffDate.Text, 5, 2) >= "01") Then
If (Right(mskEffDate.Text, 2) < "32" And _
Right(mskEffDate.Text, 2) >= "01") Then
'Do nothing as the date is valid
Else
MsgBox "You have to enter a valid Effective Date"
End If
End If
End If