Record in report bold based on criteria

  • Thread starter Thread starter wolfe
  • Start date Start date
W

wolfe

How do I change the complete record to bold if the
criteria of [field1] equals "1" or "A". Conditional
formatting will allow me to change the field, but I can't
figure out how to change the whole line (record).

Thanks!!
 
In the print event, you can write VBA code something like:

If <condition> Then
field1.fontweight = 700
field2.fontweight = 700
. . .
Else
field1.fontweight = 400
field2.fontweight = 400
. . .
End If

To change the font weight of the controls you want to vary.

Or, to change all the controls, you can use something like:

Dim ctl As Control
Dim sec As Section
Set sec = Me.Detail
For Each ctl In sec.Controls
If Me!txtRecordID > 10 Then
ctl.FontWeight = 700
Else
ctl.FontWeight = 400
End If
Next
Set sec = Nothing

Larry Linson
Microsoft Access MVP
 
Back
Top