bold font

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
 
B

Bill

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
 
J

John Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top