Format Report

sgladie@bgsu.edu

Registered User.
Local time
Today, 13:13
Joined
Jul 3, 2015
Messages
28
Access 2013
I am trying to format a field within a report. I have the event on the On Format of Detail. Two fields, if one is greater than the other, make the font red, if not, black. Here is my code:

Dim ct As Integer
Dim tc As Integer
ct = Me.TextOverUnder
tc = Me.TextAvg

If ct > tc Then
Me.TextOverUnder.ForeColor = vbRed
Else
Me.TextOverUnder.ForeColor = vbBlack
End If

If TextOverUnder is greater than TextAvg make the font red, if not, black. I can't seem to get it to work. If I put ct > 0, then it does it, but not for the field. What am I missing? Thanks!:banghead:
 
What values would the textboxes contain (ie is Integer appropriate)?
 
I believe integer is appropriate. The values are whole numbers (negative and positive), no decimals. It is actually days. For example:
TextOverUnder = DaysinStatus - TextAvg

If TextOverUnder is over the TextAvg then I want the font red.
 
I got it - thank you so much!! I can't figure out how to mark these threads SOLVED though.
 
Happy to help! You can edit the thread and change the prefix to Solved.
 

Users who are viewing this thread

Back
Top Bottom