conditional detail format

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

I have a report where I want the font of individual records to be BOLD (or
not bold) base on the value of one of the feild inthat record [revisedcom].
To do that, I have entered the code below.
The labels are visible (or not) correctly, but the font does not change? Is
this the correct method of acheiving this goal?
Is it even possiuble to change the format 1 record at a time?

many thanks in advance.
mark


Private Sub Detail_format(Cancel As Integer, PrintCount As Integer)

If revisedcom = vbYes Then
Me.Label96.Visible = True
Me.Label97.Visible = True
Me.Type.FontWeight = Bold
Me.Manufacturer.FontWeight = Bold

Else
Me.Label96.Visible = False
Me.Label97.Visible = False
Me.Type.FontWeight = Normal
Me.Manufacturer.FontWeight = Normal
End If
 
Do you understand that vbYes has a value of 6? Have you considered using
Conditional Formatting?

You should change your code to something like:

Me.[Type].FontBold = True

I would also rename the "Type" field or control to MfgType or something that
might not cause issues.
 
Mark said:
I have a report where I want the font of individual records to be BOLD (or
not bold) base on the value of one of the feild inthat record [revisedcom].
To do that, I have entered the code below.
The labels are visible (or not) correctly, but the font does not change? Is
this the correct method of acheiving this goal?
Is it even possiuble to change the format 1 record at a time?

many thanks in advance.
mark


Private Sub Detail_format(Cancel As Integer, PrintCount As Integer)

If revisedcom = vbYes Then
Me.Label96.Visible = True
Me.Label97.Visible = True
Me.Type.FontWeight = Bold
Me.Manufacturer.FontWeight = Bold

Else
Me.Label96.Visible = False
Me.Label97.Visible = False
Me.Type.FontWeight = Normal
Me.Manufacturer.FontWeight = Normal
End If

That needs to be either:

Me.Type.FontWeight = 700
or
Me.Type.FontBold = True
 
Back
Top