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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make text bold

Status
Not open for further replies.

JasnaP

Programmer
Mar 4, 2003
4
SI
Hello all,

does anyone know how can I make text bold in a report (based
on a table), if the field in the table meets certains criteria?

For example, I have fields "Price" and "Product name" in my table. In the field "Price" user can select between normal and promotional price. In the field "Product name" the user has to fill in the name of the product.

This is what I would like to do in my report: if selected price is promotional, I would like the value in the field "Product name" to appear in bold text.

Can anyone please help me?

Thanks in advance!
Jasna
 
Select the field in design view and click Format, Conditional Formatting and try that out



Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Thanks Neil, I will give it a try.

Best regards
Jasna
 
The way I got it to Bold certain text depending on the value in one of the fields is:
[tt]
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Price = "promotional" Then
        Me.FontBold = True
        Me.CurrentX = 200
        Me.CurrentY = 500
        Me.Print (Price)
        Me.CurrentX = 800 - 0
        Me.CurrentY = 500 - 0
        Me.Print (Product Name)
    End If
End Sub
[/tt]
Put that into the code for the report.

If you don't know where ot put it, ask :)

Aubs
 
I just tried this and it throws an error.

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.MATpercent < 0.4 Then
        Me.MATpercent.FontBold = True
    End If
End Sub

I tried it without the Me, like in your example, and I tried with .value after and I just can't get it to work.
any help would be most appreciated.
it's access 97.
thanx.
 
try
If Me.MATpercent < 0.4 Then
Me.MATpercent.Fontweight = bold

Hope this helps
Hymn
 
sorry, should of been
If Me.MATpercent < 0.4 Then
Me.MATpercent.Fontweight = 700

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top