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.
>>>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.