Posted 22 January 2020, 8:08 pm EST
Hello folks,
i use FlexReport and need to set the color (and other attributes) of some textfields depending on the shown values. Code like this works fine into the onPrint Event:
' Set Color to Red if Value is negativ
fldSaldo_1.foreColor = Rgb(0,0,0)
if CInt(fldSaldo_1.Text) < 0 then
fldSaldo_1.ForeColor = Rgb(233,0,0)
endif
Because of the number of fields and the things to do with one field i try writing a function (placed as globalScript) like this
Sub setFieldColor(oneField)
oneField.foreColor = Rgb(0,0,0)
if CInt(oneField.Text) < 0 then
oneField.ForeColor = Rgb(233,0,0)
endif
End sub
I like to call this by
call setFieldColor( fldSaldo_1 )
But instead to change the color of the textfield this code set the value to 233
How can i use as TextField as parameter for a sub?
Thanks in advance for any help.
Niels