Share via

Reports and their Report Headers, Group Headers and Sections; Forcing New Pages, Keeping Together and Repeating Sections; Print Preview; Access 2010

Anonymous
2010-06-12T19:52:50+00:00

I have created various reports, and I am trying to fine tune the way headers appear in the printed report [printPreview], I am not concerned, here, with the layout on ReportView.

[in simple form for discussion] I have:

  • A report header
  • A group and group header
  • Group, page and report footers
  • An empty page header
  • Detail column headings placed at the bottom of the group header section

I am trying to get:

  • the report header on the first page
  • the first group's header on thefirst page , with its details beginning thereafter on that first page
  • group headers at the top of every following page
  • a column listing/header for the detail section, under the group heading on each page
  • each new group at the top of a new page

I figured this should be real easy.  I dove in and . . .

I come close:

  • I get the report header on the first page, with nothing else on that page.  The first group begins on the next page, with detail, and group headers are on all subsequent pages, as expected, with their following detail.  New Groups begin on new pages.
  • I've gotten the report header and 1st group header on the first page, then the 1st group on the second page with detail, then the 2nd group header on a page by itself, and then the 2nd group header and detail on the third page....and so on.
  • Other results not complying with my inner fantasy about how this should work

I'll take suggestions on the settings for each of the sections for

  • Keep Together
  • Repeating Sections
  • and Forcing New Pages
  • Using the scissors and mallet on the screen . . .

And, even, using the page header section.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

14 answers

Sort by: Most helpful
  1. Anonymous
    2010-06-14T16:45:25+00:00

    An interesting insight, but in my example, I don't modify the page/pages numbers, and only set it hidden on the first page....are you suggesting that turning on/off the page break can, or is likely to be messing with the page/pages counter?   The code [to an analysis that only looks at the code] implies visibility only after the first page....

    I don't get what you mean by working with the first vs. last group.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2010-06-13T14:03:55+00:00

    My programming tool box includes my Big Bad Ball Bat, it can beat anything into whatever shape I want.  Just reaching for it is enough to make most problems snap to attention  ;-)

    I don't know if your question(s?) were actually answered.  I'm not even sure If there was a specific question, but good luck getting your report to shape up.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-06-13T13:46:03+00:00

    Thank you both for your comments.  A few comments:

    The page break control is an interesting tool, one I had not considered.

    Indeed, I have a report footer [counts and such, for the entire report...]

    And this: the scissors and mallet was my threat to use a mechanical device on the screen -- it's not part of the software toolbox, but part of my toolbox toolbox, next to the hammer, nails, and the like....

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-06-13T00:04:02+00:00

    I'd have thought all you need to do is (a) set the group header's RepeatSection property to true, (b) include the 'column headings' at the bottom of the group header, and (c) include a zero-height group footer with its ForceNewPage property set to 'After Section'.

    The first group header will then follow on from the report header, and its detail will start below the 'column headings' on page 1.  The group header, complete with column headings will repeat at the top of each page.  When the end of each group is reached a new page will be started for the next group.  The only fly in the ointment would be if you were including a non-zero height report footer, but as you don't mention one, this should not be a problem.  Note that even if the report footer is empty, if its height is more than zero an extra page will be printed after the last group.


    Ken Sheridan, Stafford, England

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2010-06-12T21:37:59+00:00

    I'll try to explain at leat some of those things.  There are two KeepTogether properties, the one for an individual section that tries to keep each instance of the section on the same page.  If the section will not fit on the remainser of the page, the entire section will be moved to the next page.  Remember this applies to each instance of the section, it does not span multiple instancees of the detail section on a group.  In your report, setting the detail and group footer sections' KeepTogether tp Yes may or may not be useful.

    The other KeepTogether is for a group (in the Sorting and Grouping window) and can be set to just keep the group header and first detail on the same page or the group header all the details and group footer on the same page.  For your report, the group KeepTogether does not meet any of your stated needs. 

    Setting the RepeatSection [rp[erty to Yes for a group header is what you are already doing because you want the header to appear on every page.  The only serious restriction with this property is that you can not use VBA code to cancel or make it invisible on some pages.  If you try, the RepeatSection property is just turned off.

    The ForceNewPage property does just what it says.  There are many times when the result is fine and then there are times when it is not flexible enough, such as setting it to Before Section for the group header prevents the first group from being displayed on the same page with the report header.  On the flip side, setting the group header's ForceNewPage to After Section shoves all the details to the next page.  Your report would get c;oser to what you want if you set the group footer's ForceNewPage to After Section, but this will put the report footer on a page by itself (or if there is nor report footer you'll get a blank page at the end of the report.

    An alternative to ForceNewPage is to use a PageBreak control.  Puttin this control at the top of a section is about the same as setting ForceNewPage to Before Section and similarly for the bottom/After Section.  The advantage for the PageBreak control is that the section can decide if it should be used or not, just by making it Visible or invisible.  For your first page issue, try using a PageNreak control at the top of the group header section along with a line of VBA code in the header's Format event procedure:

        Me.pgBreak.Visible = (Me.Page > 1)

    I haven't use A2010 enough to know what "scissors and mallet" means.

    Be more specfic about the page header section.  Generally, it does what it does.  It can be cacelled if that's useful.

    Was this answer helpful?

    0 comments No comments