Page Break Dilemma: Suggestions?

xxx

Registered User.
Local time
Today, 13:53
Joined
Apr 29, 2011
Messages
41
Page Break after subreport Dilemma: Suggestions?

Ok. So I have one report which cosists of multiple subreports (>10). The main report and the subreports are not linked nor do they need to be.

I want each subreport to start on a new page. Initially I added a page break before each subreport. The issue with this is that the subreports won't always have data. When this occurs the page breaks create a blank page. I'd like for the subreport to print even if no data exists - just print a blank report. OR if this isn't possible, at least somehow cancel print for just the blank pages.


Any suggestions?
 
Last edited:
This wouldn't be an issue if the main report would recognize page breaks in the subreports.
 
So after scouring the internet without success and realizing that I probably wasn't going to get a response, I did some brainstorming and devised a solution. Sharing here.

It will require some additional work, but achieves the objective.

Basically, I created a query that counts the number of records returned from my table query. If this Count(*) query returns 0, a statement will display "No Data found". So this query will never return null.

Then, I created a report of this Count(*) query which will contain the applicable form header info. Then, I inserted the form-report containing my data (or lack thereof) as a subreport. Then, I include this Count(*) report as a subreport in my original report,and as before I include page breaks after each subreport. So now with the new Count(*) report (which will always have data) and the the subform / data label, none of the pages will be blank and it will simply say that there was no data for that particular form.

Kinda confusing without visual example. Hopefully, the attached .doc file will illustrate.
 

Attachments

Last edited:
All you had to do was to set the subform's Report Header's FORCE NEW PAGE property to BEFORE SECTION.
 
Yeah. That doesn't seem to be working. Any ideas why?
 
Re: Page Break after subreport Dilemma: Suggestions?

I'd like for the subreport to print even if no data exists - just print a blank report.QUOTE]To avoid the extra counting routine, use the report's HasData property to test if it has data or not and hide the dummy sub-report as you see fit. The dummy sub-report will be the report that will become visible when the main sub-report doesn't have data.

OR if this isn't possible, at least somehow cancel print for just the blank pages.
What does this mean? Can you elaborate?
 
Thank you so much! For some reason this wasn't an option I had considered. I did a test with an unbound copy of one of my reports,and it did indeed print. Seems a tad odd that it will print subreports that are unbound, but not bound supreports.

I will keep this in mind for future projects. Unfortunately I'm nearly done with the Count(*) option.

This project has certainly forced me to familiarize myself with the limitations of Access (and how to work around them!).
 
It's just the way it was built. It would be nice to have a property that allows you to show a blank report when there's no data.

You're getting better at it then ;)
 

Users who are viewing this thread

Back
Top Bottom