Forum Discussion
keep group footers together on one page
I have a report that has a fixed number of detail lines per grouping.
There is one page per set of detail records.
It needs to be grouped to three levels.
I can see how to skip to a new page for each group.
I can't see any way of making sure that group totals always appear together at the bottom of the required page and not on a page by themselves.
Any ideas?
Grouped A, B, C
At the end of group C, include totals for group C at the foot of the page.
At the end of group B, suppress the new page for group C and print the totals for groups B and C.
At the end of group A, suppress the new page for groups B and C and print the totals for groups A, B and C.
On the last page of the report, suppress the new page for groups A, B and C and print the totals for groups A, B and C along with the report totals.
This is such an obvious requirement that I suspect the answer is, as ever, suck it, loser. Optimism rules!
Well, usually the first replies are boilerplate botted responses using keywords that are entirely useless.
"Here's how to create an Access report."
"Here's how to create grouping in Access reports."
"Here's how to throw a page after a group in Access reports."
"Here's how to stop access reports ending with a blank page."
It's only one downvote but it makes me feel better.
2 Replies
- George_HepworthSilver Contributor
You might need to create three subreports for the three levels. Then, in the footers for each group, you could refer to the appropriate subreport totals for the displayed incremental totals.
Take this:
- Use “Keep Together” Property
- Set the “Keep Together” property of each group section (Group A, B, C) to “Whole Group”. This helps prevent group footers from being orphaned on a new page.
- Also set “Keep Together” on the Detail section if needed.
- Conditional Page Breaks
Use VBA or conditional formatting to suppress page breaks:
- In the Group Footer sections, add logic to conditionally suppress page breaks based on whether it's the last group or nested within another:
If Me.Page = Me.Pages Then Me.GroupFooterC.NewPage = 0 Else Me.GroupFooterC.NewPage = 1 End If
- Custom Footer Aggregation
- Create unbound controls in the Report Footer or Group A Footer that manually calculate and display totals for B and C.
- Use DSum or custom logic to aggregate values.
- Use Subreports
- Create subreports for each group level and embed them in the main report.
- This gives you more control over pagination and layout.