I have searched the archives, but cannot find specifically what I'm wanting to do. When building a Sales Order, using subform SOLines, I want to change the ItemQty background color if the quantity is a negative number. If the ItemQty is a positive number, then 'no background color change'. But I need each record to retain its programmed background color in ItemQty when it switches to TableView for the PrintForm. The color difference for negative value is to aid the delivery drivers in seeing different things on the delivery ticket, which is printed with a PrintForm command.
Is it possible to have multiple subform SOLines records on a Parent OrderForm where the ItemQty LE background color can be different on each saved record (so that each line item retains its different color, both on the screen and when printed?
What's happening with the following code is:
-ItemQty:

nElementExit is changing ItemQty background to yellow if the value is negative
-this record is saved.
-Next record is created, and ItemQty background color is reset to white, FOR THE NEW RECORD, pending the subsequent value that is entered in ItemQty.
But the background color isn't being retained differently for each record, as desired.
ItemQty:

nElementChange
#Include "sbasic_include.sbas"
If @ToNumber(ItemQty) < 0
{
FormAttribute("", "ItemQty", ATTR_ID_BACK_RGB_COLOR, "252 252 0")
FormAttribute("", "ItemQty", ATTR_ID_TEXT_RGB_COLOR, "252 0 0")
ForceRedraw()
}
so far so good, but when the next record is created, and the following code executed (to insure that ItemQty background on new record begins as white, it reverts the background colors of the previously saved records, too.
Next record, on ItemNum:

nElementEntry
{
FormAttribute("", "ItemQty", ATTR_ID_BACK_RGB_COLOR, "255 255 255")
FormAttribute("", "ItemQty", ATTR_ID_TEXT_RGB_COLOR, "0 0 0")
ForceRedraw()
}