Hi,
This is Excel 2000. I have a form where the user enters a next visit date. I am trying to stop the user from entering a date that has already passed. I have this as an error checker but it does not work, just lets the form unload and enters the past date.
stDate1 refers to the value entered in a text box on my form.
Dim stdt
stdt = FormatDateTime(stDate1, vbShortDate)
If stdt <= Now() Then
MsgBox "You cannot enter a date that has already passed. Please correct the Next Visit date."
Exit Sub
End If
Does anyone know why this is not working. Thanks,
Lisa
This is Excel 2000. I have a form where the user enters a next visit date. I am trying to stop the user from entering a date that has already passed. I have this as an error checker but it does not work, just lets the form unload and enters the past date.
stDate1 refers to the value entered in a text box on my form.
Dim stdt
stdt = FormatDateTime(stDate1, vbShortDate)
If stdt <= Now() Then
MsgBox "You cannot enter a date that has already passed. Please correct the Next Visit date."
Exit Sub
End If
Does anyone know why this is not working. Thanks,
Lisa