Data Validation

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
 
A

Al Campagna

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top