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

Conditional format all text boxes in section of report. 2

Status
Not open for further replies.

fishtek

Technical User
Aug 21, 2002
56
US
I have a report in which I want all text boxes containing the symbol"<"in front of a value to be non bold. All text boxes are bold by default. I can acheive this using the conditional format menu for each one but was hoping to do it en masse with code. Thanks for your help.
 
Use the Detail Format event:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim c As Control
For Each c In Me.Detail.Controls

If c.ControlType = acTextBox Then ' just does this for textboxes
If Left(Me.Controls(c.Name), 1) = "<" Then
Me.Controls(c.Name).FontBold = True
Else
Me.Controls(c.Name).FontBold = False

End If
Else
End If
Next c

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top