Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing every second row in grey 1

Status
Not open for further replies.

FlexOLex

IS-IT--Management
Jun 20, 2003
1
CA
I am wandering if it is possible to print every other row/lines in my report in grey. I tried doing a multiple selection and change the back color to grey, but it only changes the color of the textboxes themselves not the entire row like I want it to be.

Thanks for your help!
 
In the detail part of your report, create an event procedure on the detail_format event. The following code highlights the entire row to a yellow highlighter - you can play with it to find gray.

I'm assuming that you've already figured out how to tell if you are on an oddline. If not leave another post - it's not that hard. You could just set up a global boolean, initialize it to false in the on-open event and change it on each format.

If (bChgToGray) Then
Me.Detail.BackColor = &H11FFFF 'subsitute your gray color on this line
bChgToGray = False
Else
Me.Detail.BackColor = &HFFFFFF 'this undoes the highlighting
bChgToGray = True
End If
 
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    'Michael Red.   2/13/2002.      To 'Toggle the backolor, which
    'Provides alternate line shading
    Const XorToggle = 4144959

    Me.Detail.BackColor = Me.Detail.BackColor Xor XorToggle

End Sub

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Hi Michael Red, glad to see you back to normal today, posting good answers.

Maybe you, FlexOLex and jmeadows7 might be interested in a method I posted earlier in the year at


The file to look at is AlternateRecordColour.zip

Bill
 
Sorry Bill,

Realised too late that that I didn't edit copying one of your suggestions. Honestly, not trying to take the credit for your great work.

Barbara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top