Hi I'm trying to validate an option group control on a form. I've tried the following code to no avail and can't see why it doesn't work.
If Me!PuDel = IsNull(Me!PuDel) Then GoTo DataErr
Debug.Print Me!PuDel
DataErr:
MsgBox "The information required is incompete. Please fill in Pickup or Delivery", vbOKOnly, "Data Validation Error"
GoTo Exit_Command66_Click
It brings up the message box and exits the sub but if I do click an option it still does the same thing. I've printed the value of "PuDel" ant it gives me either Null or 1 or 2 depending on what option I choose. But the validation never lets me enter the value.
I've tried "= Not 1 Or Not 2" , "<> 1 Or <> 2"as well. Can anyone help with this problem? All help will be greatly appreciated.
If Me!PuDel = IsNull(Me!PuDel) Then GoTo DataErr
Debug.Print Me!PuDel
DataErr:
MsgBox "The information required is incompete. Please fill in Pickup or Delivery", vbOKOnly, "Data Validation Error"
GoTo Exit_Command66_Click
It brings up the message box and exits the sub but if I do click an option it still does the same thing. I've printed the value of "PuDel" ant it gives me either Null or 1 or 2 depending on what option I choose. But the validation never lets me enter the value.
I've tried "= Not 1 Or Not 2" , "<> 1 Or <> 2"as well. Can anyone help with this problem? All help will be greatly appreciated.