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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight every orther row in a report detail

Status
Not open for further replies.

RJL1

Technical User
Oct 3, 2002
228
US
Last bit of help on report formating. I have a report that My boss would like to have every other row highlighted. Like green bar paper. Is there a way to do this. I got some super help from different people here and has made my project a real learning experience.

Thanks
RJL1
 
Ok, this is just a thought.

Create a box around the text items on the report. Set the fill color of box to light grey (or whatever). Set the object to "Send to Back". Next on the report create an event on the Detail Print...

If Me.Box20.BackStyle = 1 Then
Me.Box20.BackStyle = 0
Else
Me.Box20.BackStyle = 1
End If

Where Box20 is the name of the box...

just did it for a report out of curiousity and it worked fine.. htewh Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Work great Thanks. I can finally put this project down and move to whatever come next.

[thumbsup2]
RJL1

 
Another way to get the greenbar effect is to toggle the backcolor of the Detail Section of the report. Set all the textboxes in the section to transparent. In the 'On format' event of the detail section, use code like this:

If Me.Section(0).BackColor = 16777215 Then
Me.Section(0).BackColor = 13828095
Else
Me.Section(0).BackColor = 16777215
End If

This toggles between white and very pale yellow. I have found that while grey looks good on the screen, it is too dark for most B&W printers and makes the data difficult to read when printed. The pale yellow produces a very light grey tone when printed.
 
I also dislike the 'shades of grey' provided by Ms. A.

More importantly (to me) is the use of logic where simple calculation works as well (or better).

To modify the backshade, you need to either fiddle with the const (XorToggle) or get into the detail of understanding how the "color" value is packed into the long which is used to represent it. All of which is lengthy and tiresome and well documented.

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

There is never time to do it right but there is always time to do it over
 
Thanks for all the different ways. The reports look great. I notice that the code submited uses a number to define the color. Where can I find out what number belong to let say BLUE. Is the a list of numbers to use when modifying the code

Thanks
RJL1
 
To modify the backshade, you need to either fiddle with the const (XorToggle) or get into the detail of understanding how the "color" value is packed into the long which is used to represent it. All of which is lengthy and tiresome and well documented.



MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top