bold font

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a report. I would like to display the font in red or bold if
the two fields do not equal. I used the following but does not seem to
work. I put the code on the open event. What am I doing wrong? Thanks.

If Me![CP] <> Me![rprice] Then Me![New2].ForeColor = vbRed Else:
Me![New2].ForeColor = vbBlack
 
You might find the "Conditional Formatting" more readily
suited to your task. While in design mode, right-click the text box
of interest and choose "Conditional Formatting". There you will
see several "built-in functions" to make the necessary comparisons
and the accompanying formatting choices that are available to you.
Bill
 
Try putting the code in the Format Event of the appropriate section.
Probably the detail section format event.

If Me![CP] <> Me![rprice] Then
Me![New2].ForeColor = vbRed
Else
Me![New2].ForeColor = vbBlack
end if

You could also try using conditional formatting.
 
Back
Top