Alternating Color Detail Back Color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A2k

Any pointers on how to implement alternating colors on the detail back color
for a report (ie green bar)?
 
A2k

Any pointers on how to implement alternating colors on the detail back color
for a report (ie green bar)?

Make sure the BackStyle of each control is Transparent.

Code the Detail Format event:

If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If

====
If you wish each page to start with a white row, code the Page Header
Format event:

Me.Detail.BackColor = 12632256 'Reset color to Grey so that the
first detail line will become white

Change the colors as needed.
 
Jay said:
A2k

Any pointers on how to implement alternating colors on the detail back color
for a report (ie green bar)?


Set all the control's (in the detail section) BackStyle
property to Transparent. Then use a little code in the
detail section's Format event procedure:

With Me.Section(0)
If .BackColor <> vbWhite Then
.BackColor = vbWhite
Else
.BackColor = RGB(200,255,200)
End If
End With
 
hi Jay,
Any chance of this working with Forms?
Create an artifical count in your data source, e.g.

SELECT To.*,
((SELECT Count(*)
FROM Table Ti
WHERE Ti.ID < To.ID
) Mod 2) AS AlternateColor
FROM Table To

Use a TextBox bound to AlternateColor and use conditional formatting.


mfG
--> stefan <--
 

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

Back
Top