Re: exception to MsgBox
- From: "Tom Ogilvy" <twogilvy@xxxxxxx>
- Date: Thu, 13 Apr 2006 22:05:18 -0400
You asked a specific question and got a specific answer. It the choices are
not "A" "B" or "C", then the answer isn't appropriate
If the choices are actually three text strings of multiple characters than
checking for a len of 1 is inappropriate.
Dim s as String
s = "#" & Trim(Me.cboDealer.Value) & "#"
if instr(1,"#AAAAA#BBBBB#CCCCC#", _
s,vbTextCompare)>0 then
If Trim(Me.txtPO.Value) = "" Then
Me.txtPO.SetFocus
MsgBox "Please enter a Purchase Order Number."
Exit Sub
End If
End if
Replace AAAAA, BBBBB, and CCCCC with your text strings.
--
Regards,
Tom Ogilvy
"L Scholes" <pwpd406@xxxxxxxxxxxxx> wrote in message
news:1144978523.725700.27540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In your code you have "ABC" on line 3. When I substitute for my list,
should I include the names without spaces or commas within one set of
quotes, or list each separately in their own quotes, separated by
commas?
.
- Follow-Ups:
- Re: exception to MsgBox
- From: L Scholes
- Re: exception to MsgBox
- References:
- exception to MsgBox
- From: L Scholes
- Re: exception to MsgBox
- From: Tom Ogilvy
- Re: exception to MsgBox
- From: L Scholes
- exception to MsgBox
- Prev by Date: Re: Creating a form with option buttons
- Next by Date: Re: passing variables between 2 forms
- Previous by thread: Re: exception to MsgBox
- Next by thread: Re: exception to MsgBox
- Index(es):
Relevant Pages
|