Link to home
Start Free TrialLog in
Avatar of APD Toronto
APD TorontoFlag for Canada

asked on

Conditional Page Break

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.
ASKER CERTIFIED SOLUTION
Avatar of Luke Chung
Luke Chung
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...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