Function::Internal

SetColor
SetColor("objectname#number(optional)","font","fill","border")
SetColor("MyField","-1","#00ff00","-1")
SetColor(concat("MyField#",MyRecordNr),"#ff0000","-1","#ff0000")

To change the color of an object during runtime. You can change font, fill and border color.

Parameters

ObjectName#number(optional)

This is the Object name (not the field name) of the object. It will alway have to be presented between "" i.e. "myfield". It is case sensitive and you need to make sure that there are no leading or trailing spaces.

Object names are mostly unique in a form, but when you use a Subform the same object names might be repeated many times (cloning) and as the subform is another form object inside the form the original object names from the main form might be repeated.

You can change object names both in main and sub forms, but you cannot get unique names for object names in a multiple record view. To get around this we have included an optional counter so you can decide which of the many similarly named objects you want to manipulate.

"MyField#8" will change the object number 8 in the form. Remember that it counts from top to bottom and left to right. One pixel higher and an object is before in the object order. All clones (subforms) will be in order and after each other.

Font

Text value for the RGB code for font. Preceded with # means hex value.
-1 is interpreted as Inherit original colour i.e. no change.

Fill

Text value for the RGB code for fill. Preceded with # means hex value.
-1 is interpreted as Inherit original colour i.e. no change.

Border

Text value for the RGB code for border. Preceded with # means hex value.
-1 is interpreted as Inherit original colour i.e. no change.