Color change for a negative value

I

IIf Issue

Is there a way that a negative value can have it's color changed to red so it
stands out to other data?
 
O

Ofer

On the on print property of the section where the field is on write the code
if me.FieldName < 0 then
me.fieldname.BackColor = 255 ' red
else
Me.fieldname.BackColor = 16777215 ' white
End if
 
D

Douglas J. Steele

From the Help file:

Custom number formats can have one to four sections with semicolons (;) as
the list separator. Each section contains the format specification for a
different type of number.

Section Description
First The format for positive numbers.
Second The format for negative numbers.
Third The format for zero values.
Fourth The format for Null values.

For example, you could use the following custom Currency format:

$#,##0.00[Green];($#,##0.00)[Red];"Zero";"Null"
 
Top