View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
L Scholes L Scholes is offline
external usenet poster
 
Posts: 54
Default exception to MsgBox

I am currently running this code to prevent users from leaving a
TextBox (txtPO) empty:

If Trim(Me.txtPO.Value) = "" Then
Me.txtPO.SetFocus
MsgBox "Please enter a Purchase Order Number."
Exit Sub
End If

I would like this to only apply if "A," "B," or "C" are entered into
cboDealer which is on the same user form. Otherwise I want the user to
be able to leave this TextBox Empty. Can anybody provide me the
appropriate code?

Thanks in advance for all of your help!