Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Conditional Page Break

Posted on 2011-09-06
2
Medium Priority
?
539 Views
Last Modified: 2012-05-12
Hello Experts,

My client has asked me for a really unique request, and I hope you can provide me with an idea or two on how to make this happen...

I have a commissions report with the following layout:

   Location group
      Sales Person (Agent) Group
          Transactions List

After printing, my client actually cuts each agent's section, placing it in an envelope with a cheque.  

This works for them, but the problem is that an agent may just start at the bottom of one page and finish at the top of the next.  As well, I cannot place a page break after each agent, as most have 2 or 3 transactions, which will generate 200 pages with more than 80% of the pages being empty.

A single page sometimes can comfortably fit 4 agents on it, so what i'm looking for is if I can execute the folowing condition:

      If Agent group does not finish on current page, start on next page

One exclusion, however, in the very rare cases, that one agent may have many transactions spanning to more than one full page, i do not want the above logic to cause an endless loop, where it will never fit one the "current" page, moving forward to the next page, which will become the new "current" page.

For the time being, i would like to keep this within Access/VBA, but am also open to exporting it to another Office or 3rd party apllication.

Many thanks in advance.
0
Comment
Question by:APD_Toronto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Luke Chung earned 2000 total points
ID: 36489350
There's a KeepTogether prorperty for groups that will do what you want. Set it to Yes, and it will make sure the whole group stays on one page, and if not, issues a page break before it.

If the group itself is more than one page, it will go beyond that of course but that's expected.

More resources including report tips on our Microsoft Access Developer Help Center.

hope this helps.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36489450
...else post a small sample DB that demonstrate the issue, and post a graphic example of the *exact* output required for each scenario... based on the sample data
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question