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

Bold and Italic Font for record in report based on value

Status
Not open for further replies.

jpkeller55

Technical User
Apr 11, 2003
131
US
I am using the following code to make a record BOLD based on the value of another field on a report in Access 2000. How can I modify this code to make it BOLD and ITALIC?
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If MedcoPt <> 0 Then
    PatientName.FontBold = True
       Else
    PatientName.FontBold = False
       End If
End Sub
Thanks for your help!
 
Is there a reason why you are not using Conditional Formatting for this?

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If MedcoPt <> 0 Then
        PatientName.FontBold = True
        PatientName.FontItalic = True
       Else
        PatientName.FontBold = False
        PatientName.FontItalic = False
       End If
End Sub


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I am not sure how to do conditional formating in this case.
I basically want the record to print on the report in bold and Italic if the value of MedcoPt = -1 (it is a check box on the form and report). I had tried the same code you posted prior to my post and it returns the record as ITALIC only, no bold.

Any other suggestions?
 
OK, figured out how to do this using the Conditional Formatting property on the field in the report and Help in Access. Thanks, this is much easier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top