Link to home
Start Free TrialLog in
Avatar of Michael Damiano
Michael Damiano

asked on

Page Break, breaks for multiple pages

My problem involves rogue page breaks. I'm using MS Access in Office 365. I have an application that creates legal documents for 15 different states. The application has seven base reports from which to build these documents. Because of the various states boiler plate,  page breaks occur at different places. I need to force page breaks in order to keep paragraph headings with at least one line of the corresponding paragraph.

All seems to work well accept when developing about the 10th state, the last page break creates multiple page breaks instead of just one as expected.  The total page breaks in a report is between 12 to 18, although each state uses no more than four or five.

Once the "seal" on this issue is broken, then all of the reports have the same issue, even prior reports that had been working.  I'm wondering if I should re-install MS Access? Perhaps one of the MS Access system files has beeen corrupted?

Any thoughts?
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

<<The application has seven base reports from which to build these documents.>>

 I would doubt it's the Access install, but rather the report engine is doing it's best to meet everything you told it to do, and can't carry it out.

 For example, if you specify "keep together".   That's not a given, only a request to do so.   If it can't do that (the section spans more than a page), it doesn't stop printing, but lets the section break.

My typical troubleshooting with reports is to go back to square one; turn all special features off, like keep together, repeat section, remove any page break controls, etc. and then look at the report again and try to introduce what's needed.  iI's easy sometimes to use a property to get a result, then do something on top of that which doesn't seem to work right, but it's the earlier setting getting in your way.

Also keep in mind that you do have a page break control and also that you can use sub reports in some cases.

One other thought; make sure your using a True Type font.   If you happen to be based on an older font, what you see on screen might not result in what you see on the printer.  

Beyond that, without seeing the report and the data, that's about as much as I can offer for ideas.

Jim.
Personally like Jim advised i would create a report that dynamically adapts to each state and have them print one by one...
e.g
State 1
Report.Recordsoure = SourceForState1
....
print the report
***********
***********
State 15
Report.Recordsoure = SourceForState15
....
print the report
When it comes to page breaks at the end of a section, and I would hope that you have all the data under a particular State (as in a US territory) in a section, and you're using the "start new page" property at the end of the section to break to a new page for the next state.

If you're getting many page breaks somewhere, it might be caused by no data for those states (empty page), or (a new version of) Access may not be handling well the method you are using to generate page breaks (Access isn't expecting you to be trying to do that).

What is your mechanism for creating page breaks?  How is your report grouped and sorted?  Are you putting in page breaks the way Access was designed to do it, or did someone "jury-rig" a method that's now out of control?  Are you using subreports for each state?

The answer is in there somewhere....
p.s. don't be shy to include screen shots....
Avatar of Michael Damiano
Michael Damiano

ASKER

Thanks for the your thoughts.  I thought that sub reports might help, but it didn't as I still needed a page break to have the sub report run on a different page.

I've attached a few snippets of the report in the report version and in design mode, as well as the portion of the code that makes the page break visible.   I can't show too much as the documents are severance reports for a major corporation which I obviously need to keep confidential.

After the page that I'm providing to you, the page break renders a multitude of blank pages.  Strange.
Any help would be greatly appreciated as I have spent hours trying to come up with a solution.
Thank you,
Michael
LastPage.JPG
SectionOfCode.JPG
ReportInDesignView.JPG
Advice is still the same; turn off everything and anything feature wise.   Leave your page breaks in and see if it makes a difference.

 I would also hide all the subreports and page breaks, then add one at a time until you see the problem.  

 The approach your taking with the page break controls should work.  But with that said, one of the other Experts here is dealing with the exact same problem and is using the same approach after trying quite a few different approaches, which is spurious page breaks.  

 I'll see if he can't offer anything more.

Jim.
Sorry, Michael, I'm the "other expert" Jim mentioned above and even I have been unable to totally resolve this issue with the report I'm working on for my client.

What I've done for that client is place all of my sub-reports in the main reports ReportFooter section.  Each subreport is preceded by a page break control.  Then, in the ReportFooter_Format section, I have code which looks like:

me.pgbrk_sub1.Visible = me.sub1.Report.HasData
me.pgbrk_sub2.Vislble = me.sub2.Report.HasData

Hope this is helpful, but I'm still getting a rogue page break, which is causing an occasional (not on every client) blank page when the report is run.  good luck.

Dale
Hey Mike:

What's the criteria for a page break?  Is it at the end of the data for a State (data records for multiple States in the report?).

Also, in your "Report In Design View. JPG", are those unbound subreport controls, textboxes, or what?

How I handle things like this is use a query on the main form that has those fields that specify sections and sorting, like a list of the States that are in the report, etc.  Then I add sections based on that data and add my subreports in the details section and link the subreports to the data in the main report section.

In other words, I use a main report query to control the order and grouping of the data in my sections and details.  Putting a "Force Page Break After Section" then creates a new page at the beginning of a new State, etc.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.