Colouring alternate detail lines code doesn't work

D

Daveo

Hi there,

I used the following code on one report and it worked perfectly.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 14742526 ' tan colour
Else
Me.Section(0).BackColor = vbWhite
End If

End Sub

However, I have another report which is very similar to the first one,
except it has an extra level of grouping on a particular field with a
group header and footer. With this report, the code doesn't work and
all the lines remain white. Does anyone know why this is?


Many thanks,

David
 
R

Rick Brandt

Daveo said:
Hi there,

I used the following code on one report and it worked perfectly.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 14742526 ' tan colour
Else
Me.Section(0).BackColor = vbWhite
End If

End Sub

However, I have another report which is very similar to the first one,
except it has an extra level of grouping on a particular field with a
group header and footer. With this report, the code doesn't work and
all the lines remain white. Does anyone know why this is?

Are you still trying to change the color of the Detail section? That is what
Section(0) is.

Do you still have the code in the Detail section's Format event?

Did you remember to put [Event Procedure] into the OnFormat event property box?
 

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