Highlight every other row

  • Thread starter Thread starter Janet
  • Start date Start date
J

Janet

I read a tip once about how to hightlight every other row
in a printed report (like the old green bars on computer
printouts), but when I tried it I couldn't get it to
work. Does anyone know how to do this? I want every
other row to print with a gray background to make reading
the report easier.
 
Janet,

Here's one way, if you are using Access 2000 or later...
1. Put an unbound textbox on the Detail section of the report, with its
Control Source set to =1 and its Running Sum property set to Over All,
name it for example RowCounter, and set its ForeColor to white.
2. Size this textbox to cover the entire section, and then click the
Format|Send To Back menu.
3. Then go to the Format|Conditional Formatting menu, and enter a
condition Expression Is: RowCounter Mod 2 = 1 and set the forecolor and
backcolor both to grey.
 
I read a tip once about how to hightlight every other row
in a printed report (like the old green bars on computer
printouts), but when I tried it I couldn't get it to
work. Does anyone know how to do this? I want every
other row to print with a gray background to make reading
the report easier.

Janet,
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

====

Change the colors as needed.
 
I suppose this works for reports as well as forms. I haven't tried
it... do you know Cheryl?
 
Well, darn! Just realized that this was the Reports not the Forms ng.
Obviously not the most helpful response.
 
Well, darn! Just realized that this was the Reports not the Forms ng.
Obviously not the most helpful response.

Cheryl and Steve,
I wondered why you both were making this more difficult than it is.
But then, I've been there and done that too. :-)>
 
Hi Fred,

In my case, the answer is simple... I never thought of the elegant
solution that you provided :-) Thanks!

On the other hand, it is often good for a code-free option to be
available for the original poster's consideration ;-)
 
Back
Top