Remove Blank last page in Access report with group page break

Robert Hester
Robert Hester used Ask the Experts™
on
I have searched around and did not find a straight forward and clear solution for removing a blank last page in an  Access report with group section page break (not the toolbox control). Can someone please help?

Thanks in advance?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chris BRetired

Commented:
You will get blank pages if -

The page is too wide, or empty/all report controls (fields) are not set to can shrink/grow = yes.

Chris B
Hamed NasrRetired IT Professional

Commented:
Are you using force new page after section?

Attach a sample database, reproducing the issue.

Author

Commented:
hnasr:,

Yes...I am using force new page after group footer and there is no problem with page width or margins...
There are many pages on the report and the only empty page is the last one.
I´ve no doudt the solution is to make use of code - the reasi=on I am asking for help...
Thanks
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!

Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
"Remove Blank last page in Access report with group page break"
*Totally* blank? ...or do you still have the Date and the number of pages on the bottom of this "Blank Page"?

In any event, this will happen if you have the "Force New Page" property of the Group footer set to: After Section
And you have just a little bit of the Report Footer visible in Design view.

So in design View, reduce the height of the Report Footer Section to Zero (0), and the issue should go away.

Sample attached
Database110.mdb

Author

Commented:
HI,

I have been experimenting and found out different behaviours between Access 2003 and 2010.

Everything works fine with 2003. There are no blank/empty pages appearing there.

My concern is really in Access 2010 - I need this to work for this version.

The height of my report footer has always been zero...but I do have controls within both page header and footer.sections (so last page is actually never empty).. But still had no success even after removing page header and footer.sections

Your kind sample also did not work in Access 2010
I did zero the length of page header and footer and the same occured: there it was: the last and empty page.

Thanks

MIS Liason
Most Valuable Expert 2012
Commented:
Then try this:

I added code, controls, ...etc, ... to match the number of records in the report with the number of records in the recordsource.
If they match, then turn off the force new page setting.

JeffCoachman
Access-EEQ26866681HideBlankPages.mdb
Hamed NasrRetired IT Professional

Commented:
Does it work with access 2007?
If not, attach the database.

Try boag2000's comment http:#35071847 first.

Author

Commented:
boag2000,
I´m sorry. but your sample mdb did not work in Access 2010. The code seems fine, but it does not trigger. I even changed the default Force new page in the Properties window to NONE, and that´s how the report was generated - even having your two conditions set to 2 - kind of like igmoring the code

Author

Commented:
hnasr,

I´m trying to make this work in Access 2010.
Didn't understand your suggestion to attach database..

Thanks
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Make sure you are opening the Report Explicitly in "Print Preview".
(either by setting it in the Report Open arguments, or setting Print Preview as the default view in the Report's properties.)
Report View is the default for Acc07 and newer, but most code won't trigger in Report View.

Author

Commented:
Yes...I confirm so...opening in Print Preview...now what? Seems we´re so close...
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Not sure,

I just downloaded my own sample and tried it in Access 2010, it worked fine...
(No blank page was generated...)

Are you saying that my sample (as downloaded) does not work?

...Or are you replicating my system in your database, and it is not working?

Author

Commented:
Very neet solution...I am very grateful...

Author

Commented:
boag2000,

Bingo!!!
When you mentioned it worked on your Access 2010 I tried it once more on mine and discovered that the security setting on my Access 2010 (installed just a few days ago) was set  so no code was being executed.
Sorry to have taken a bit more of your time.
Thanks a lot...
I replicated the code in my actual database, my report also had a grouping on user. The code your provided is working. I was just hoping to resolve one more item.

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