Conditional format (1 Viewer)

pl456

Registered User.
Local time
Today, 06:01
Joined
Jan 31, 2008
Messages
150
I have a field called results that I want to format to fill red. It currently checks the value of expr1 field and if greater than this value formats.

[results]>[expr1]

expr1 picks data up in the query, an iif statement, so expr1 can sometimes have a "" value.

My problem is that I also need results to compare values bewteen two other fields expr2 & expr3 and if outside this range format to fill red.

I cannot get my head around how to write this expression, beacause surely it will hit the first condition which will always be true
e.g.
results = 10, expr1 = "" 10 is greater

Is it possible to have two conditions like this?
 

jdraw

Super Moderator
Staff member
Local time
Today, 01:01
Joined
Jan 23, 2006
Messages
15,393
I have a field called results that I want to format to fill red. It currently checks the value of expr1 field and if greater than this value formats.

[results]>[expr1]

expr1 picks data up in the query, an iif statement, so expr1 can sometimes have a "" value.

My problem is that I also need results to compare values bewteen two other fields expr2 & expr3 and if outside this range format to fill red.

I cannot get my head around how to write this expression, beacause surely it will hit the first condition which will always be true
e.g.
results = 10, expr1 = "" 10 is greater

Is it possible to have two conditions like this?


if [results]>[expr1] OR _
NOT ( [results] Between Expr2 and Expr3)

something like that. But if expr1 ="" what is supposed to happen?
 

pl456

Registered User.
Local time
Today, 06:01
Joined
Jan 31, 2008
Messages
150
Nothing is supposed to happen when the expr is "".

The db lists tests so for each test type you get a results. The expr field lists the upper limit for the test, when the result is above i want it to fill red.
The expr field can have "" as a value because the underlying query uses many IIF statements to return an upper limit or "" for each test type and combines them into one field (expr1).

Its all fine with most tests but one of them has a range rather than a single upper limit.

(tell me if I am explaining this like an idiot)
 

pl456

Registered User.
Local time
Today, 06:01
Joined
Jan 31, 2008
Messages
150
I figured out a way to do this, thanks for responding.

Although I do have another issue with the formatting not liking the numbers I enter in results.

The rule I have set formats if results > than expr1 which works. so lets say
results = 7
expr1 = 6
field should be filled red, which it is.
However if
results = 13
expr1 = 12
field is not filled

I don't think it likes the number 1 in 10, 11, 12, 13 etc it is treating it as a number 1.
 

Users who are viewing this thread

Top Bottom