Syntax to check multiple criteria with If

ejstefl

Registered User.
Local time
Today, 07:10
Joined
Jan 28, 2002
Messages
378
I'm blanking on the proper syntax... If I have an IF statement in which I want to check multiple criteria, what's the best way to do it? Here's how I have it set up now:

Code:
IF me.lstbox.itemdata(i) = "Condition 1" or me.lstbox.itemdata(i) = "Condition 2" or me.lstbox.itemdata(i) = "Condition 3"Then
Do stuff
End If
What's an easier way to check for one of many conditions all at once?
 
Multiple If's

You could consider select case

Select Case a1
Case "Invoiced"
do action 1
Case "Paid", "part paid"
do action 2
Case Else
do action 3 if 1 and 2 fail
End Select

Note case 2 - it is multiple selections - easier to see

George
 
Beautiful, thank you!!
 

Users who are viewing this thread

Back
Top Bottom