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

Bold certian records in report

Status
Not open for further replies.

mauricionava

Programmer
Jul 8, 2005
209
US
Hi, I have a report where it shows a bunch of dates. When the date field is empty in the query, I entered an IIf statement with a message "N/A". Is there a way to bold that message so the N/A could stand more out?

Thanks
 
It should be possible to set the FontWeight property for the textbox.

Me.txtNA.FontWeight = 700 'Bold, Normal=400
 
But what I want is the the text that shows in the if statement to show in bold.

For example, I have a "Release" field. Some records have not been released so I entered an If statement with If release date null, then "Not Released". I want the "Not Released" to show in bold in the report and the rest of the dates in the same field in regular font.
 
Hi there!
Select the field you want to bold and select Format>Conditional Formatting

Expression:
=[!][MyControl][/!].[Value]="N/A"

Apply whatever formatting to highlight your data and click OK.

Hope this helps.

Tom

Born once die twice; born twice die once.
 
What should I put in [MyControl] ?
I get a invalid syntax error.

Thanks
 
I figured it out.

I went to Conditional Formatting for the field and set is as: Field Value Is: equal to: "my text" and set it in bold and red.

Works Ok.

Thanks!
 
How are ya mauricionava . . .

For the [blue]VBA[/blue] version . . . in the [blue]On Format[/blue] property of the [blue]Detail Section[/blue], copy/paste the following:
Code:
[blue]   Dim ctl As Control
   
   Set ctl = Me![purple][b]FieldName[/b][/purple]
   
   If ctl = "N/A" Then
      ctl.FontBold = True
      ctl.ForeColor = vbRed
   Else
      ctl.FontBold = False
      ctl.ForeColor = vbBlack
   End If
   
   Set ctl = Nothing[/blue]
In reports you can accomplish much more powerful formatting!

If you try this, don't forget to [blue]remove the conditional formatting[/blue] first . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top