access report format

  • Thread starter Thread starter Robin
  • Start date Start date
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
 
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.
 
Back
Top