IN Function for Access VBA

Michael T picture Michael T · Jun 9, 2013 · Viewed 9.1k times · Source

Is there a function in Access VBA that works like the IN function in SQL?
I'm looking for something like:

if StringValue IN(strA, strB, strC) Then

Answer

Tom Collins picture Tom Collins · Jun 9, 2013

While sgedded's answer is correct, here's another way that I think is a little cleaner code.

Select Case stringValue 
    Case strA, strB, strC
        'is true statements
End Select

http://msdn.microsoft.com/en-us/library/gg278665(v=office.14).aspx