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

Strange printing from report problem

Status
Not open for further replies.

cmunnelly

Technical User
Jul 4, 2003
16
GB

I am using conditional formatting in a report. It previews fine (Row text in red when tick box = true) when i print it doesn't print red text. I then placed a text box within the details section of the report and made the text red and the all the text on the report became red. Had this before???
 
Perhaps attempt to use code in the report to set the color property of the obect instead. That is what I do, when I need a report to do green bar type print outs... htwh,
This will give a green bar effect on a report. Every other line green. You may want to play around with the numeric color expressions if you don't like the loud green you get from vbGreen. Just a tip...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.Detail.BackColor = vbWhite Then
Me.Detail.BackColor = vbGreen
Else
Me.Detail.BackColor = vbWhite
End If

End Sub



MichaelRed (Programmer) Jul 12, 2004
Somewhat easier:

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

Of course, the const used in this provides a light grey, but you can use a different constanta and get any color desired.


Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Thanks for your response. The report looks ok in preview i do not want to colour every other line. I just want the report to print out the way it is displayed on screen.
 
As described, attempt to use VBA Code in Detail_Format() to control color pairings based on your conditions. The code provided is only an example of how to manipulate a property.


Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top