Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Field to Bold Red

Status
Not open for further replies.

JJman

Technical User
May 8, 2003
89
0
0
IN
I'm no VBA guru, but I'm trying to use the code below to change the appearance of a field to bold red if the condition is met. It changes the font color to red just fine, but does not bold it. Nor does it give me any kind of error. Can someone please tell me what I'm doing wrong?

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)

If Avg1 >= 3 Then
Avg1.ForeColor = vbRed
Avg1.FontWeight = vbBold
End If

End Sub

 
Hi JJman,

I don't think there is a vbBold. You could try ..

Code:
[blue]Avg1.FontWeight = 700[/blue]

.. or ..

Code:
[blue]Avg1.FontBold = True[/blue]


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Why don't you use Conditional Formating...? Try the format menu in your report edit view...
 

Hi Acdel,

I was using conditional formatting before, but it wasn't working. It would apply the formatting even when the value was only 2. Very strange, I know. This is why I decided to code it instead. Anyway, I'll give Tony's ideas a shot.

Thanks to you both!
 


Both ways worked great, Tony. Thanks again. May I ask where you got the value of 700 for bold formatting? I'd love to have a list of things like that.
 
Hi JJman,

All the information is in Help (under FontWeight).

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top