Question:
How can I change a row’s color when printing a report according to a field’s value?
Solution:
To do so, add a script to report’s OnFormat event to check the field’s Text property. For example:
Sub OnFormat
Set Detail = Report.Sections(“Detail”)
Set Field2 = Detail.Controls(“Field2”)
If Field2.text > 50 then
Field2.ForeColor = RGB(255,0,0)
Else
Field2.ForeColor = RGB(0,0,0)
End if
End Sub
See attached demo application.