Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 16th, 2007, 02:38 PM
Authorized User
 
Join Date: Mar 2004
Location: Knoxville, TN, USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Rood67
Default Shading Every Other Line In A Report

Hello all,

Simpler problem this time than some of the others I've posted... ok, to me it's simpler.

I have used the following code successfully in the past to shade every other row of a report. However, a new report I have set up, this shades every other row on some pages, and not on some pages, and at times skips several pages all together, then resumes shading like nothing was wrong.
====================
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    If Me.Section(0).BackColor = vbWhite Then
        Me.Section(0).BackColor = 12632256
    Else
        Me.Section(0).BackColor = vbWhite
    End If
End Sub
====================
The report is used to subtotal and then grand total a table with customer orders. The breakout is on the customer number, and set to start a new page every time the customer number changes.

I don't know if for some reason there's actually more than section zero or not. I've never had a problem from this code in the past several years I've been using it.

Any help or suggestion will be most appreciated,

Rood67
__________________
<b>Rood67</b>
 
Old October 17th, 2007, 06:34 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Did you try the code on the Detail section's On Format event? That is where I would usually put this sort of code.



mmcdonal
 
Old October 18th, 2007, 09:00 AM
Authorized User
 
Join Date: Mar 2004
Location: Knoxville, TN, USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Rood67
Default

Hi Mac,

No, I put the code on the Detail sections - On Print event. I'll try it in the On Format and see if it does any better.

On a happy note, Access2007 has this ability built in for any report. When you go to the property sheet for the Detail section and click on the format tab. The 3rd and 4th option for me are Back Color and Alternate Back Color. So I set one to White the other to Grey.

This works great for me, having 2007 installed. My only concern is that I want to be able to send the .mdb file to one of our partner companies that does not have 2007, they are still using Office 2003. If I send this file up to them, and they go to print the report, what will they get?

I know the shading code will work in Access97 to Access2007. However, in this one report, its the first time I've had a problem with it since I started using it.

Rood67




Similar Threads
Thread Thread Starter Forum Replies Last Post
Shading on remember me check box and login backgou mmmctigue BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 July 20th, 2007 09:10 PM
Line Drawing in Report Prashant Shah Java Basics 1 August 10th, 2006 10:52 PM
Line Drawing in Report Prashant Shah VB How-To 2 August 8th, 2006 01:02 PM
Line Drawing in Report Prashant Shah General .NET 0 August 8th, 2006 08:51 AM
Line Drawing in Report Prashant Shah Crystal Reports 0 August 8th, 2006 08:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.