Report / Subreport's Report Footer totals printing alone on last page

bschulze

Active Member
Joined
Jun 2, 2005
Messages
289
Hello all, i've given up and could use your help. Access 2013.

I have a Report which has two subreports in the detail section of the main report. The subreports both have a report footer section which contains totals. All records and totals are displaying correctly, my issue is that it's possible for the report to expand to a 2, 3, 4, etc... pages, but the subreport report footer to be the first item on a page. I would like to have at least one detail record on the page prior to the totals.

I've played with the following properties GrpKeepTogether, KeepTogether, NewRowOrCol and others but cant seem to figure it out. The two subreports can be moved into a group footer if that will help.

Appreciate any assistance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I've played with a combination of these properties on the main report and both subreports. I'm not trying to bring totals from the subreport to the main report.

Imagine there being enough page space to display only 20 records per page. If 19 records are called on the subreport, the 19 records and 1 totals field (subreport report footer section) is displayed on page one. If 24 records are called, 20 will display on page one, 4 will display on page two alone with the totals. Both of these examples are perfectly acceptable. The issue I have is when there is 20 records, all 20 records are displayed on page 1 while the subreports report footer section containing the totals is pushed to page 2, all by itself, due to page space considerations.

I'm likely looking for some code to verify this scenario per page and if found move a record or records to the next page (possibly by making a spacer section visible?). Providing the DB is not an option, although this example is easily duplicated.

Let me know if further clarification is needed.
 
Upvote 0
Providing the DB is not an option, although this example is easily duplicated.
If you cannot provide a copy, that's understandable. But with all due respect, I'm not about to create tables/queries/reports/subreports to attempt to duplicate your issue. Maybe what you need is to code on the report section format property (property details here) and (here) to limit the number of records and cause a page break at some number.

This code is from Experts Exchange and relies on a hidden textbox that sums overr group and (supposedly) forces a new page at 15, but I've never tried it. One thing I don't get is the Mod word.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtRowCount Mod 15 = 0 Then
   Detail.ForceNewPage = 2   ' after section
Else
   Detail.ForceNewPage = 0   ' none
End If
End Sub
or this idea (you'd modify so as to not simply cancel the printing, but move to a new page instead).
Note that the event doesn't fire in on report view - only print preview.
Good luck!
 
Upvote 0

Forum statistics

Threads
1,215,876
Messages
6,127,482
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top