Validation Error


M

MKuria

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.IM_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
 
Ad

Advertisements

S

Stefan Hoffmann

hi,

any question? Errors? Something we can work with?
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.IM_District_Issues_Concerns.SetFocus
Cancel = True
Maybe your condition is lacking of parentheses:

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]
(


mfG
--> stefan <--
 
Ad

Advertisements

M

MKuria

Thanks Stefan for responding - I have been getting error messages when
posting to site so.
I made the recommended changes and it works.
--
mmk


Stefan Hoffmann said:
hi,

any question? Errors? Something we can work with?
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.IM_District_Issues_Concerns.SetFocus
Cancel = True
Maybe your condition is lacking of parentheses:

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]
(


mfG
--> stefan <--
 

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