IIf Help!!!

  • Thread starter Thread starter Fia
  • Start date Start date
F

Fia

How can I use an IIf function if I wan't to have 3 diffrent answers.
I'll will try to explain whet I mean.

If the value is neither True or False then I want to give the value of Ord
back.
I can't use the code below, because if Ord is another value than True or
False for example a string, "Hej", I'll get 0 back from the IIf-function. I
know I can use an if and else statement, but not in this case.
IIf(Ord=True,-1,0)

Please help

Fia
 
Use a nested IIF as below to return -1 if true, 0 if false or 2 if neither
true nor false
IIf(Ord=True,-1,IIf(Ord=False,0,2))
 
How can I use an IIf function if I wan't to have 3 diffrent answers.
I'll will try to explain whet I mean.

If the value is neither True or False then I want to give the value of Ord
back.
I can't use the code below, because if Ord is another value than True or
False for example a string, "Hej", I'll get 0 back from the IIf-function. I
know I can use an if and else statement, but not in this case.
IIf(Ord=True,-1,0)

What's the datatype of Ord? If it's an Access Yes/No field then True
(-1) and False (0) are the only values that it CAN have!

John W. Vinson[MVP]
 
Back
Top