Link to home
Start Free TrialLog in
Avatar of jolodali
jolodali

asked on

How to log page numbers of group footers so I can suppress printing page headers?

I have a report that includes a group footer that I print on its own page.  The report has a page header (column headings for the detail info) that doesn't make sense to display with the group footer.  I recently posted this question (24142767) and accepted an answer that proposed using subreports to handle.  Another approach that was brought up was logging the group footer pages and then suppressing the page headers based on the logged page numbers.  I would like a little more explanation on how to accomplish.  
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

LOL

I'll be working on this this morning if another Expert does not complete it first.

JeffCoachman
Actually, a lot of the info can be found here.

http://support.microsoft.com/kb/131937

I'm still working on it though...

Jeff
Avatar of jolodali
jolodali

ASKER

Thanks Jeff - It looks like you might not have much competition on this one.  I will be out today entertaining my 2 most complex systems (they're 10 and 12 - it's winter break :-)  
Will check back later.  
 
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Jeff ...

As the saying goes ... "Great Minds Think Alike ..."  

Seems like what I came up with is pretty close to your solution with the exception of your command to open the report.  In my sample and test as long as you included the Page X of Total Pages control on the report then it will automatically force Access to make the two passes.  Therefore, it's probably not necessary to open the report twice as shown below.  What are your thoughts????

ET


Private Sub Command0_Click()
    'Sets the variable that detremines whether or not tblReport Pages is loaded or not.
   
    'On the First run the table is not loaded.
    blnpubTableLoaded = False
    DoCmd.OpenReport "rptCustomerOrders", acViewPreview, , , acHidden
   
    'On the Second run the table should be loaded.
    blnpubTableLoaded = True
    DoCmd.OpenReport "rptCustomerOrders", acViewPreview

End Sub
Thanks so much to both of you.  I tried both approaches and they both worked beautifully.  I ended up implementing  ET's solution because it required that little bit less coding and I have another similar report that needs this fix.  
Note to anyone else reading this thread:  I opened this question as a continuation of another question (24142767).  When I closed the original, I awarded full points to ETSherman.  However, JeffCoachman suggested an alternative solution which he (and ET) elaborated on in current question.  This is why I split points on this question with majority going to Jeff.
etsherman,

My first objective was to get it working.
Then I tweaked it up to what I posted.
I used the blnpubTableLoaded Public Variable to keep track of whether or not the table should be loaded.  Because I was going around in circles trying to get the logic just right depending on what "Pass" I was in, if I tried to do this all by opening the report just once.

Just commenting out the the first section of my code, while PageX of Y was still displayed
did not produce the desired results, when the number of records changed.

If your code adapts, for this, then I'm all for it.

My concern from a simpler standpoint was,: What happens if Page X of Y is not there?

With my solution, I just tried to grab the problem by the scruff of it's neck, and wrestle it into submission.
;-)

Jeff
jolodali ...

Glad you got it working.

Jeff ...

Not a problem as I'm sure there's probably a couple other ways you can do that.  I just included that comment in case you were not aware that by including the Page X of Total Pages control on the report, Access will automatically perform the two passes.

Again, your idea and solution to the orginal question was the most practical approach and sounds like the asker is happy.

ET
etsherman,

"in case you were not aware that by including the Page X of Total Pages control on the report, Access will automatically perform the two passes."

Actually I didn't know that.

Thanks

;-)

Jeff