Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case 1 OR 2

Status
Not open for further replies.

MagnusFox

IS-IT--Management
Jan 12, 2001
51
US
Good day,

Select EventID
Case 1 OR 2
'Do something
Case 3
'Do something else
End Select

Well I am a bit confussed with this one. I want to use the same code for multiple cases. This would allow me save repeating the "Do something" portion for both cases 1 and 2.

However, It does not seem to be working. I do not receive an error with this code, but I do not "Do something" when EventID is 1 or 2.

I did get and error with this:
Case 1 OR Case 2

It did not like the "Case 2" gave me a "Syntax Error"

As always, any help is great!
 
Crap I feel like a buffoon! I read that very page earlier today to find the answer on my own. I skipped over the most important sentence in the article for addressing my issue:
”A comma delimited list of one or more expressions.”

So, for those of you playing the at home, here is the answer to todays “Stump the Buffon Quiz”

Select EventID
Case 1,2
'Do something
Case 3
'Do something else
End Select
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top