Solved

Remove Blank last page in Access report with group page break

Posted on 2011-03-06
16
5,476 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
  • 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
 
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 500 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now