The Or condition in my If clause is not working and seems to give no results.My target is to achieve a condition by which either quantity or cartons is null.
That is to say if quantity is Null but cartons is not, the code should allow the process and not discontinue.
But this doesnt happen. The code i have written looks only for quantity, and if quantity is null, the message appears, regardless that i have entered cartons.
Obiisouly my Or in the If condition is not right. Any help ?
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Quantity) And Me.Parent!customerid <> 123 Or (Me.cartons) And Me.Parent!customerid <> 123 Then
MsgBox "You must enter either quantity or cartons", vbCritical
Cancel = True