Data Validation

  • Thread starter Thread starter SPK
  • Start date Start date
S

SPK

I have a date field set as DD/MM/YYYY Format with options for entering
numerics as NA/ND/Un. I want to validate the date field with respect to
another date field. I.e., the date entered should be greater than or equal to
the date format in another field. Can anybody help.

Thanks
 
SPK,
Not sure I understand the NA/ND/Un part, but regarding entering a date,
and comparing it to another date...
Use the BeforeUpdate, and using names Date1 and Date2...

Private Sub Date1_BeforeUpdate(Cancel As Integer)
If Me.Date1< Me.Date2 Then
MsgBox "Date1 less than Date2"
Cancel = True
Date1.Undo
End If
 
Back
Top