Conditional Page Break
Posted on 2011-09-06
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:
Sales Person (Agent) Group
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.