?
Solved

Remove Blank last page in Access report with group page break

Posted on 2011-03-06
16
Medium Priority
?
6,332 Views
Last Modified: 2015-02-27
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?
0
Comment
Question by:Roberth509
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
  • +2
16 Comments
 
LVL 28

Expert Comment

by:burrcm
ID: 35054873
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
0
 
LVL 30

Expert Comment

by:hnasr
ID: 35061435
Are you using force new page after section?

Attach a sample database, reproducing the issue.
0
 

Author Comment

by:Roberth509
ID: 35069515
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
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35069716
"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
0
 

Author Comment

by:Roberth509
ID: 35070306
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

0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 35071847
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
0
 
LVL 30

Expert Comment

by:hnasr
ID: 35072105
Does it work with access 2007?
If not, attach the database.

Try boag2000's comment http:#35071847 first.
0
 

Author Comment

by:Roberth509
ID: 35081872
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
0
 

Author Comment

by:Roberth509
ID: 35081880
hnasr,

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

Thanks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35083705
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.
0
 

Author Comment

by:Roberth509
ID: 35089147
Yes...I confirm so...opening in Print Preview...now what? Seems we´re so close...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35095225
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?
0
 

Author Closing Comment

by:Roberth509
ID: 35104039
Very neet solution...I am very grateful...
0
 

Author Comment

by:Roberth509
ID: 35104080
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...
0
 

Expert Comment

by:rjordanbots
ID: 40635854
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.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question