display the value depending on logical condition

S

skk

I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report? Or any other suggestion will be appreciated. Thanks
 
M

Marshall Barton

skk said:
I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report?

Formatting should be done in the presentation object, i.e.
the report.

Use Conditional Formatting (Format menu) on the report text
box that displays the value. Select the Expresion Is option
and enter:
[Tot Yes] = [Tot Count]
then set the color property to green.

Click the Add button, then use the expression:
[Tot Yes] > [Tot No] And [Tot NO] > 0
and select Yellow in the apporpriate property.

Click Add again the get the third formatting option. Use
the expression:
[Tot No] > [Tot Yes] And [Tot NO] > 0
for Red.
 
S

skk

Thanks a lot for your reply Marshall. It works!

Marshall Barton said:
skk said:
I have query with "Tot Count", "Tot Yes", "Tot No" and depending on count of
"Y" or "N" I would like to color code this made up field (give value Green,
Yellow, Red).

the logic to give a value is:
If ("Tot Yes" = "Tot Count") = Green
If (("Tot Yes" > "Tot No") = Yellow) & (Tot NO <> 0)
If (("Tot No" > "Tot Yes") = Red) or & (Tot NO <> 0)

Is there a way I can have those three conditions & give a value to either in
query or report?

Formatting should be done in the presentation object, i.e.
the report.

Use Conditional Formatting (Format menu) on the report text
box that displays the value. Select the Expresion Is option
and enter:
[Tot Yes] = [Tot Count]
then set the color property to green.

Click the Add button, then use the expression:
[Tot Yes] > [Tot No] And [Tot NO] > 0
and select Yellow in the apporpriate property.

Click Add again the get the third formatting option. Use
the expression:
[Tot No] > [Tot Yes] And [Tot NO] > 0
for Red.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top