Conditional Color Formatting

S

Scott

I have a report with a field called Difference which is calculated by
[PriceOverride]-[PriceDefault] if the difference is more than two I want the
value display color to be red if it is less than or equal to two I want the
value display color to be black. How do I do that?

Thanks,

Scott
 
J

Jackie L

On the OnFormat property of the Detail section of your report put:

If me.Difference >2 then
Me.Difference.Forecolor= 128
Else
Me.Difference.Forecolor = 0
End If

The 128 indicates a "red" color. You can put any red color in that formula.

Hope this helps.
Jackie
 
F

fredg

I have a report with a field called Difference which is calculated by
[PriceOverride]-[PriceDefault] if the difference is more than two I want the
value display color to be red if it is less than or equal to two I want the
value display color to be black. How do I do that?

Thanks,

Scott



You can use Conditional Formatting.

Set the control's forecolor to Black.

Select that control.
Click on Format + Conditional Formatting
Set Condition1 to
Field Value Is
Select
less than or equal to
in the next drop down.
Then enter 2 as the value.

Select the Red forecolor color.
Save the changes.
 
S

Scott

Worked great, thank you!

fredg said:
I have a report with a field called Difference which is calculated by
[PriceOverride]-[PriceDefault] if the difference is more than two I want the
value display color to be red if it is less than or equal to two I want the
value display color to be black. How do I do that?

Thanks,

Scott



You can use Conditional Formatting.

Set the control's forecolor to Black.

Select that control.
Click on Format + Conditional Formatting
Set Condition1 to
Field Value Is
Select
less than or equal to
in the next drop down.
Then enter 2 as the value.

Select the Red forecolor color.
Save the changes.
 
Top