Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    67

    Question Unanswered: check if value is in a set of values

    I want to write an IF...THEN statement that checks the value of a control against a set of values. It would look something like:

    If value = In(10,21,34,55,62,104) Then

    It would be the equivalent of writing:

    If (value = 10) Or (value = 21) Or (value = 34)...

    Is there a function like 'In(a,b,c,d)' ???

    Thanks,
    David
    /dmset

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    You might do better with Select Case

    Select Case value
    Case 10,21,34,55,62,104
    'some code
    Case 11,22,35
    'some other code
    Case Else

    End Select
    Inspiration Through Fermentation

Posting Permissions

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