Highlight rows gray every other row Issue

  • Thread starter Thread starter Darby Holmes
  • Start date Start date
D

Darby Holmes

I attempted to implement the following old post - although
at the end of each row (starting at 1) it added 2 each
time - how can I make it such that the numbers don't show
up at all??:

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: Report.RowCounter Mod 2 = 1 and
set the forecolor and
backcolor both to grey.
 
I attempted to implement the following old post - although
at the end of each row (starting at 1) it added 2 each
time - how can I make it such that the numbers don't show
up at all??:

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: Report.RowCounter Mod 2 = 1 and
set the forecolor and
backcolor both to grey.

I have no idea what your original question was, but are you trying to
alternate the back color of the detail section for each record?

Try this method to shade the Detail Section.
(Remove the added control you mentioned in the above message).

Make sure the BackStyle of each control in the section is Transparent.

Code the Report's Detail Format event:

If Me.Detail.BackColor = vbWhite Then
Me.Detail.BackColor = 12632256 ' gray
Else
Me.Detail.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 to gray so that the
first row will always be white.

Change the colors as needed.

No need to add any counting control or colored rectangle, or whatever.
Hope this is helpful.
 
Back
Top