Good work guys, too bad we left on Saturday before we finished this.
This is the next step. Make the code into a generic Sub Routine that can be used for any checkbox:
SubRoutine srCheckBoxColor(vElementName as String)\
//Insert into Global Code
//Call from ImmediateChange on checkbox elements
//Call from frmName/FormEntry to set colors based on stored values
SetThisElement(vElementName)
If ThisElement = 1 Then {
RGBColor(ThisElement, -1, -1, -1, 0, 255, 0)
} Else {
If @IsBlank(ThisElement) Then {
RGBColor(ThisElement, -1, -1, -1, 233, 227, 199)
} Else {
RGBColor(ThisElement, -1, -1, -1, 255, 0, 0)
}
}
UnsetThisElement()
End SubRoutine
Usage:
1. Put the SubRoutine above into Global Code section.
2.To use this just call the Sub Routine in the code section for Immediate Change, entering the name of the element as the parameter like this for three different elements:
For the element named Taxable, enter
srCheckBoxColor("Taxable") in the code section for Immediate Change.
For the element named Candidate, enter
srCheckBoxColor("Candidate") in the code section for Immediate Change.
For the element named Active, enter
srCheckBoxColor("Active") in the code section for Immediate Change.
3. And in the Form Code, in the section for Form Entry, call the Sub Routine for each check box.
srCheckBoxColor("Taxable")
srCheckBoxColor("Candidate")
srCheckBoxColor("Active")
Colors can be changed as desired for individual preferences.