Alternating Row Colr

S

Scott

Is there a easy way to alternate the background color property in the detail
section of a report?
 
T

tina

try the following code, as

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

If Me.Detail.BackColor = 16777215 Then
Me.Detail.BackColor = 16777130
Else
Me.Detail.BackColor = 16777215
End If

End Sub

the above alternates the color from light blue to white; substitute any
colors you want.

hth
 
R

Rick Brandt

Scott said:
Is there a easy way to alternate the background color property in the
detail section of a report?

In the Format event of the detail section...

If Me.Detail.BackColor = vbWhite Then
Me.Detail.BackColor = vbGreen
Else
Me.Detail.BackColor = vbWhite
End If
 
S

Scott

One problem, my text boxes with values have a white background by default.
In order to make the row be white and alternate to a color, do i have to
have the code change their back color also?
 
T

tina

normally, textbox controls in a *report* have a Transparent backstyle by
default. did you change it to Normal? or are you working with a *form*,
rather than a report?

the code that Rick and i gave you won't work in a form. if you *are* working
in a report, just change all the controls' BackStyle property to
Transparent.

hth
 
S

Scott

it's a report. thanks.


tina said:
normally, textbox controls in a *report* have a Transparent backstyle by
default. did you change it to Normal? or are you working with a *form*,
rather than a report?

the code that Rick and i gave you won't work in a form. if you *are*
working
in a report, just change all the controls' BackStyle property to
Transparent.

hth
 

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