Field Validation

abby_1309

Registered User.
Local time
Today, 11:52
Joined
Mar 11, 2009
Messages
15
I have 3 dates Field "M11Qdate","DateSubmitted","DateDue"
I want to apply Validation On It
1)Cannot Left "DateSubmitted" Blank (user should not be able to go to next Control until there is a Date in "DateSubmitted"
2)"DateSubmitted" Cannt be less then "M11Qdate"
3)"DateDue" cant be greater then "DateSubmitted"
 
I would use the control's Before Update event and also the Form's before update event to validate the data.

example:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)

' perform data validation
If IsNull(Me.CompanyName) Then

   MsgBox "You must enter a Company Name.", vbCritical, "Data entry error..."
   DoCmd.GoToControl "CompanyName"
      
   Cancel = True

End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom