Need Code for If is Not Null, See attached below

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I need it to check if Customer_ID has a value in it, that is it has a
customer entered in the control, and if not MsgBox.
I am missing something I know !

Thanks,

Dave

If IsnotNull(Customer_ID) Then
MsgBox "Need Customer Please"
Cancel = True
End If
If IsNull(Combo6) Then
MsgBox "SalesPerson Needed Please"
Cancel = True
End If
 
I think you want something like this:

If isNull(me.customer_id) then
msgbox "Need Customer Please"
cancel=true
me.customer_Id.setfocus
endif
If IsNull(me.Combo6) Then
MsgBox "SalesPerson Needed Please"
Cancel = True
me.combo6.setfocus
End If

The setfocus method puts the cursor back to the offending control.
 
Thank You, Really Appreciate it.

Dave

Sandra Daigle said:
I think you want something like this:

If isNull(me.customer_id) then
msgbox "Need Customer Please"
cancel=true
me.customer_Id.setfocus
endif
If IsNull(me.Combo6) Then
MsgBox "SalesPerson Needed Please"
Cancel = True
me.combo6.setfocus
End If

The setfocus method puts the cursor back to the offending control.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Dave said:
I need it to check if Customer_ID has a value in it, that is it has a
customer entered in the control, and if not MsgBox.
I am missing something I know !

Thanks,

Dave

If IsnotNull(Customer_ID) Then
MsgBox "Need Customer Please"
Cancel = True
End If
If IsNull(Combo6) Then
MsgBox "SalesPerson Needed Please"
Cancel = True
End If
 
Back
Top