Select case statement

arage

Registered User.
Local time
Today, 12:56
Joined
Dec 30, 2000
Messages
537
Select case statement

>>>I tried writing this:<<<

If Right(globalregioncode, 2) = "00" Then
Select Case globalregioncode
Case "1100" Or "1200" Or "1300" Or "1400" Or "1500"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
End Select
End If

>>Instead of this:<<<

If Right(globalregioncode, 2) = "00" Then
Select Case globalregioncode
Case "1100"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
Case "1200"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
Case "1300"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
Case "1400"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
Case "1500"
DoCmd.ApplyFilter , "[directorcode]=" & globalregioncode
End Select
End If

But I find that the former will not work. but shouldn’t it as I am separating the CASE expressions with an OR? Please advise.
 
Try this:

Case "1100", "1200", "1300", "1400", "1500"

I think that's how it goes.

HTH.
 
thanks!
 

Users who are viewing this thread

Back
Top Bottom