Type mismatch win In statement

on an after update event I have code to see if the Country ID is one of a little list of IDs.

I am getting a type mismatch for this:
If "Me![Country] In(2,3,4,13,25,9,27,28)" Then
Me![VAT] = False
end if

what am I doing wrong here?
LVL 1
ShawnAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You can do this instead:

    Select Case Me![Country]
        Case 2, 3, 4, 13, 25, 9, 27, 28
            Me![VAT] = False
        Case Else
            ' do whatever
    End Select

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
The IN() operator only works in a Query (SQL), not in VBA.

mx
0
 
ShawnAuthor Commented:
ah right. thanks for the refresher :)
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You are welcome.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.