conditional detail format

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
 
D

Duane Hookom

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.
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top