Results 1 to 3 of 3

Thread: Or's (A2002)

  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Or's (A2002)

    Hello All,
    Is there an alternate (and more efficient!) way to do mutiple OR's within an IF statement? I usually use something like this:

    If strLoginId = 1 Or strLoginId = 2 Or strLoginId = 9 Or strLoginId = 50 Then........

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Or's (A2002)

    You can use Select Case:

    Select Case strLoginID
    Case 1, 2, 9, 50
    ' Code goes here
    Case 3 To 8
    ' Code goes here
    Case Else
    ' Code goes here
    End Select

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Or's (A2002)

    Thanks Hans!

Posting Permissions

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