Check if a variable belongs to a set of values
Solved
panda
-
Panda -
Panda -
Hello,
I just want to check with a condition if my variable belongs to a set of values.
Of course, I can do:
If Var = 1 or Var = 5 or Var = 12 or..... then
but it's a bit tedious when there are a lot of tests.
There should be something like
if Var = (or(1, 5, 12...)) then
or
if Var = {1; 5; 12...} then
I'm sure there is something like that and the answer will be obvious, but I can't find it. I specify that this is VBA for Access.
Configuration: Windows XP / Firefox 8.0.1
I just want to check with a condition if my variable belongs to a set of values.
Of course, I can do:
If Var = 1 or Var = 5 or Var = 12 or..... then
but it's a bit tedious when there are a lot of tests.
There should be something like
if Var = (or(1, 5, 12...)) then
or
if Var = {1; 5; 12...} then
I'm sure there is something like that and the answer will be obvious, but I can't find it. I specify that this is VBA for Access.
Configuration: Windows XP / Firefox 8.0.1
it's easy, all you had to do was think of it!