Select Case Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a case statement in Access 97 that is as follows. There is more to
the case statement, but the rest of the statement is like this piece:

Select Case FundCHeck("Fund_Class")
Case "NCF"
If [cboMedia] <> "01 or "02" Then
MsgBox "This Media is not supported by this fund"
End if

Fund_Class is a text field, as is cboMedia. If I take out the or "02", the
statement works fine. When I add the 'or "02" ' in, if the cboMedia = "01"
the message box will populate.

What am I doing wrong?
 
RobL said:
I have a case statement in Access 97 that is as follows. There is
more to the case statement, but the rest of the statement is like this
piece:

Select Case FundCHeck("Fund_Class")
Case "NCF"
If [cboMedia] <> "01 or "02" Then
MsgBox "This Media is not supported by this fund"
End if

Fund_Class is a text field, as is cboMedia. If I take out the or
"02", the statement works fine. When I add the 'or "02" ' in, if the
cboMedia = "01" the message box will populate.

What am I doing wrong?

Hi Rob,

How about:

If ([cboMedia] <> "01") AND ([cboMedia] <> "02") Then

HTH
 
Thanks. Works great

RuralGuy said:
RobL said:
I have a case statement in Access 97 that is as follows. There is
more to the case statement, but the rest of the statement is like this
piece:

Select Case FundCHeck("Fund_Class")
Case "NCF"
If [cboMedia] <> "01 or "02" Then
MsgBox "This Media is not supported by this fund"
End if

Fund_Class is a text field, as is cboMedia. If I take out the or
"02", the statement works fine. When I add the 'or "02" ' in, if the
cboMedia = "01" the message box will populate.

What am I doing wrong?

Hi Rob,

How about:

If ([cboMedia] <> "01") AND ([cboMedia] <> "02") Then

HTH
 
Back
Top