We help IT Professionals succeed at work.

Type mismatch win In statement

Shawn
Shawn asked
on
Medium Priority
333 Views
Last Modified: 2012-05-11
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?
Comment
Watch Question

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
The IN() operator only works in a Query (SQL), not in VBA.

mx
Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
ah right. thanks for the refresher :)
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
You are welcome.

mx
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.