Link to home
Start Free TrialLog in
Avatar of Robert Hester
Robert Hester

asked on

Remove Blank last page in Access report with group page break

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?
Avatar of Chris B
Chris B
Flag of Australia image

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
Avatar of Hamed Nasr
Are you using force new page after section?

Attach a sample database, reproducing the issue.
Avatar of Robert Hester
Robert Hester

ASKER

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
"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
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

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
Does it work with access 2007?
If not, attach the database.

Try boag2000's comment http:#35071847 first.
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
hnasr,

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

Thanks
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.
Yes...I confirm so...opening in Print Preview...now what? Seems we´re so close...
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?
Very neet solution...I am very grateful...
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.