I have a money element, Breakout_Total, which is a combined total of 5 other money elements. It is filled when any of the other elements changes, and its value should equal my Invoice_Total. It needs to be filled if a particular text field, Coding2, contains more than one character and if its value does not equal Invoice_Total. I want to alert this need to my users by changing its color to a light red if both conditions are met (its default color is a grayish yellow).
I have tried the following code in On Form Entry, On Form Reveal, and On Draw:
// Sets the color of the Breakout Total element
IF @LEN(Coding2) > 1
THEN
{
IF NOT (Breakout_Total = Invoice_Total3)
THEN RGBColor(Breakout_Total, 0, 0, 0, 255, 100, 40)
}
ELSE RGBColor(Breakout_Total, 0, 0, 0, 223, 229, 146)
In each event usage I get strange results. One is that the element will not change color unless you actually click on the form. Until you do it remains the same color as the previously viewed form. (And once it has been colored, the next form retains that color even if the conditions are incorrect, until, again, you click on the form.)
I'm hoping to be able to allow my users to just F10 from form to form, watching for a red element, but if they have to click on each form for it to change color the effort is pointless (I realize I could just do a programmed search on the length of Coding2, but my users couldn't unless I set up a command button for them).
Clearly there's something I'm overlooking or unaware of when it comes to conditional coloring of elements. Any help would be appreciated.