Blank last page when using "Force new Page" in group footer

eshurak
eshurak used Ask the Experts™
on
Hello,

I've got an access 2010 db that is printing an extra blank page at the end.  I'm using "Force new Page" in group footer as each group needs to be on it's own page.  Please help.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
LucasMS Dynamics Developer

Commented:
Check your margin settings.  I usually put them all to 0.25 and then my page width i can go as far as 8.5 in portrait mode.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:

  Is the last group on it's own page?

Jim.

Author

Commented:
It's not the margins.  The problem disappears when I don't use "Force new page" after the group.  This is a new problem since upgrading to 2010.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Hi Jim,

The last page is totally blank except for the page header and footer.  The group footer that is set to "Force New Page after" is also set to not visible.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Not 100% sure about 2010...
But try something like this on Format event of the Group footer:

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
Dim lngKeyPage As Long
lngKeyPage = Pages - 1
    If Page = lngKeyPage Then
        Me.Section("GroupFooter1").ForceNewPage = False
    End If
End Sub


The Report must be opened in "Print Preview" explicitly in order for this to work
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Notes:

1. Not really sure, but set the Visible property of the section back to: True
2. If you need a Grand Total then you may have to add a running sum field and hide it on every page but the last (Key) Page...?
3 < I'm using "Force new Page" in group footer as each group needs to be on it's own page. >
To be clear, this setting makes sure that each group "Starts" on a new page, ...it cant force 300 records (if this is how many records a group has) to magically "Fit" on one page.

JeffCoachman
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
try this,
...the Page count is off by one though...

I'm swamped right now, so if another Expert has time to tweak this, or has a more elegant fix, feel free...
Database76.mdb
Commented:
Wow, thanks Boag for all your suggestions, but none of them really did the trick.  I played around with grouping and force new page setting and found the by setting the group footer force new page to after selection I did not get the extra page any more.  I also changed it to "Do not keep group together on one page".  I'm not sure what the silver bullet does, but I was able to do it without code (even on the sample the you sent me as well).

Thanks again.

Author

Commented:
I hate not giving points to people but I want people who are searching EE in the future to be able to find answers.
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
<I hate not giving points to people but I want people who are searching EE in the future to be able to find answers.>
Other members searching here should be your only concern.
You solved your own issue and you stated how you did it.
So in this regard, think of yourself as the "Expert" who answered the question.

Good Work

;-)

Jeff

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial