>THISFORM.text18.VALUE=(var1+var2)-THISFORM.text17.VALUE
>
>IIF (THISFORM.text18.VALUE <0,THISFORM.text18.FORECOLOR=RGB(255,0,0) , THISFORM.text18.FORECOLOR=RGB(0,0,0))
>
>I want the font show in red if the value is negative
>
This doesn't do what you want; the result of the IIF() as given retgurns a logical value; if text18.value is < 0, it evaluates whether text18.forecolor is presently set to RGB(255,0,0), and otherwise, it evaluates if text18.forecolor is presently set to RGB(0,0,0); what you want to do is have the IIF assign a new value to text18.ForeColor based on its value:
WITH thisform.text18
.forecolor = iif(.value RGB(255,0,0), RGB(0,0,0))
ENDWITH
You assign the value of a function to a variable, field or property (in this case, you want to assign a new value to the forecolor property); the problem is that the function evaluates the argument, and since it's legal to test a property against the return from a function of the same type, you aren't getting an error - it seems to not be doing anything.
>Thanks in advance
>
>Ulises