Date Function (Data Validation)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to prevent someone from entering data into Date Handled that is a
future date i.e. greater than today. I've tried swapping Date with Today,
and it doesn't seem to work. I can only enter in todays date (May 5), I
can't enter May 1.

Any suggestions?

If Me.Date_Handled > Date Then
Cancel = True
MsgBox "Date Handled must be equal or less than today"
End If

Thanks!
 
your routine is fine - but it depends what Date Handled is (what type of
control) & which event you are using - After Update event (the logical
choice) doesn't support Cancel - if so just leave that line out
 
Back
Top