Help with "IIf" expression

racdata

Registered User.
Local time
Today, 07:24
Joined
Oct 30, 2002
Messages
74
Hi all

I have a field where I enter a measurement. Then the reading will be callculated in another control and then display a number - -1, or 0, or +1

1050 [text222]-1045= 5 IIf([Text223]>=0,"Wide","Narrow")

If it is -5 it display "Narrow" Thats Fine

I can't get it to display OK if the reading is 0
From 0, +1 it display Wide

Now the problem that I have is: Display -1 Narrow
0 OK
+1 Wide
 
Yes it will work, have a look at the sample attached.

Just open the query and you will see the result.
 
Last edited:
IIf Problem

John

What you gave me is exactly what I have

I want Narrow to display if the result is -1, -2, -3 etc.

If the reading is 0 (Null) display OK.

Display Wide if the reading is +1,+2,+3 etc

The IIF expression allow you to enter only 2 - "Wide","Narrow"
 
Put this in TxtResult (in the query)

Code:
txtResult: IIf([Result]=0,"OK",IIf([Result]>0,"Wide","Narrow"))

When I saw this;
I can't get it to display OK if the reading is 0
I took the OK to mean "correctly" not that you wanted it to display "OK"

sorry about that.
 
IIf Problem solution

Thanks it works perfectly
 

Users who are viewing this thread

Back
Top Bottom