access report format

R

Robin

Hello.

I am trying to shade every second row in a report.
row
row
row - shaded
row
row
row - shaded

I am using this code which shades alternating rows and works great.
if value = true then
(condition)
else
(condition)
end if

thanks for any help you can pass on
 
M

Marshall Barton

Robin said:
I am trying to shade every second row in a report.
row
row
row - shaded
row
row
row - shaded

I am using this code which shades alternating rows and works great.
if value = true then
(condition)
else
(condition)
end if


Your pseudo code is too vague to explain anything.

Access 2007 has a built in feature to color alternating
rows.

In earlier versions the technique is to add a (hidden?) text
box (named txtLineNum) to the detail section. Set its
expression to =1 and RunningSum to OverGroup.

Then the code in the detail section's Format event could be
like:
If txtLineNum Mod N = 0 Then
Me.Section(0).BackColor = RGB(255,255,128) 'pale yellow
Else
Me.Section(0).BackColor = vbWhite
End If

Replace N with the number of lines to alternate, e.g. for
every other line, 3 for every third line.
 

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