By "In", are you referring to the SQL In operator, as "WHERE fieldname
In (1, 2, 3, 4)"? AFAIK, that operator doesn't exist in VBA, though
there are several ways to do the equivalent. One is the Select Case
statement; e.g.,
Select Case expression
Case 1, 2, 3, 4
' ... do something ...
Case 5, 6, 7, 8
' ... do something else ...
Case Else
' ... do the default thing ...
End Select
There is an IIf function in VBA and a very similar, but not
quite identical, function in SQL. Help explains the VBA
function fairly well.
In is an SQL operator, but it is not avaliable in VBA.
However you can use it in the Eval function.
y = Eval( x & "IN (1,2,3,4)" )
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.