Page break after 3 groups

  • Thread starter Thread starter bcbrock
  • Start date Start date
B

bcbrock

I have a report based on two related tables, so I'm grouping the
data.

Is there a way to force a page break after every 3rd group?

TIA.
 
You could add a page break named [PageBreak3] at the bottom of the detail
section. Add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: over all
Visible: No

Then add code to the On Format event of the detail section like:
Me.PageBreak3.Visible = (Me.txtCount Mod 3 = 0)
 
Thank you for the information - I'm sure this will work once I get
around just a bit of a snag...

Since I need to have 3 groups of data per page, I modified your
instructions as follows: (changes in UC)

You could add a page break named [PageBreak3] at the bottom of the
GROUP FOOTER
section. Add a text box to the GROUP FOOTER section:
Name: txtCount
Control Source: =1
Running Sum: over all
Visible: No

Then add code to the On Format event of the GROUP FOOTER section like:
Me.PageBreak3.Visible = (Me.txtCount Mod 3 = 0)


When I print preview, I get the following error message:

"Can't find the object 'Me'. If 'Me' is a new macro or macro group,
make sure you have saved it and that you have typed its name
correctly."

I placed the code directly on the On Format line for the Group Footer
section.

What am I missing that Access can't find the 'Me' object? I'm using
Access 2007, BTW.

Thanks again! :-)
 
The code I provided should go in the code/module window, not the property
sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top