In the detail section OnFormat event use this code:
[tt]
If MyValue > 5 Then
MyTextBox.ForeColor = vbRed
Else
MyTextBox.ForeColor = vbBlack
End If
[/tt]
You do not need the DIM statements for this code. MyValue was meant to be the value you are inspecting (IE: a textbox with a numeric value). MyTextBox was meant to be the name of the textbox on your report that you want to change the color of.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.