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!

Highlight Record Based on Criteria 2

Status
Not open for further replies.

wonderwhy

Technical User
Dec 30, 2002
99
US
Hello!

What is the best way to highlight certain records in a report based on the value of a field (like all records where the field called Status = "Complete").

Thank you so much for your help.

Julia
 
If by highlighting you mean something like bolding you could do this:

In the On format event of your detail section, put code like this:
Code:
If Me.Status = "Complete" Then
   Me.txtField1.FontBold = True
   Me.txtField2.FontBold = True
Else
   Me.txtField1.FontBold = False
   Me.txtField2.FontBold = False
End If
This will bold all controls listed if the Status field meets the criteris....Just include all detail fields...
 
Thank you CosmoKramer! I would really rather change the background color of the records where status= "Complete" to a light gray. Can you explain how to do this, too?

Thanks again,

Julia
 
Sure, try this:
Code:
If Me.Status = "Complete" Then
   Me.Detail.BackColor = 12632256
Else
   Me.Detail.BackColor = vbWhite
End If
 
This works great! I put it in the On Format property of the detail section.

Thanks!

Julia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top