M
MKuria
I am running the code below to validate 2 fields entered in a form and if
they fall oustide the given dates - user has to complete the concerns field.
If is not working.
Help
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[District_Issues_Concerns]) And
Me.[Scheduled_Date_Supply_Delivery] < Me.[Phase_Start_Date] Or
Me.[Scheduled_Date_Supply_Delivery] > Me.[Phase_Completion_Date] Then MsgBox
"Date entered - Explain", vbOKOnly
Me.[District_Issues_Concerns].SetFocus
Cancel = True
Else IsNull(Me.District_Issues_Concerns) And
Me.Scheduled_Date_Box_Destruction < Me.Phase_Start_Date Or
Me.[Scheduled_Date_Box_Destruction] > Me.Phase_Completion_Date Then MsgBox
"Date entered - Explain", vbOKOnly
Me![District_Issues_Concerns].SetFocus
Cancel = True
End If
End Sub
they fall oustide the given dates - user has to complete the concerns field.
If is not working.
Help
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[District_Issues_Concerns]) And
Me.[Scheduled_Date_Supply_Delivery] < Me.[Phase_Start_Date] Or
Me.[Scheduled_Date_Supply_Delivery] > Me.[Phase_Completion_Date] Then MsgBox
"Date entered - Explain", vbOKOnly
Me.[District_Issues_Concerns].SetFocus
Cancel = True
Else IsNull(Me.District_Issues_Concerns) And
Me.Scheduled_Date_Box_Destruction < Me.Phase_Start_Date Or
Me.[Scheduled_Date_Box_Destruction] > Me.Phase_Completion_Date Then MsgBox
"Date entered - Explain", vbOKOnly
Me![District_Issues_Concerns].SetFocus
Cancel = True
End If
End Sub