Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select case statement (97)

    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

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Select case statement (97)

    Hi,
    You don't actually want the 'Or's in there. Try:
    Case "1100", "1200", "1300", "1400", "1500"
    instead.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select case statement (97)

    thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •