Solved

Conditional Page Break

Posted on 2011-09-06
2
485 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
2 Comments
 
LVL 10

Accepted Solution

by:
Luke Chung earned 500 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now