Colorizing columns with @For

I have a column where I would like to show any values less than 0 (zero) in Red. The column shows multiple values as separate entries and displays values from a field with up to 6 numbers.I should mention that the view shows fields from multiple forms as well. Forms 1 and 2 only have one value. It’s form 3 that has the multiples.

In the color column (to the left) I placed the formula:

@If((Form = “Form1” | Form = “Form”) & Amount < 0 ; 255:0:0;

@For(n := 1; n <= @elements(afield); n := n + 1;

tTemp := @If(  afield[n] < 0; 255:0:0;  0:0:0);

tTemp ) )

So for forms 1 and 2 - they show red - but for form 3 (the else condition above) it always evaluate to 1.

Can I even get this to evaluate to a color value instead?

I appreciate any comments.

Subject: Solved - Please Disregard…

.

Subject: Solution:

was to move the for loop outside the if statement:

@For(n:= 1; n<= @Elements(afield); n:= n + 1;

temp := @If((Form=“Form1”|Form=“Form2”) & Amount < 0 ; 255:0:0; afield[n] < 0; 255:0:0; 0:0:0));

temp