Having tried this on a dummy database, I can see how difficult this really
necessary procedure is. It'll be needed for all sorts of things, like
putting invoices onto pre-printed sheets or for insuring that the list of
items has a neat box around them on the first page so I bet that there is a
solution out there.
I thought I'd got a solution to this but perhaps someone else can supply the
missing link.
What we'll do is to provide a field inwhich groups your records in groups
of 5 (that's supposing that the pack slip will hold 5 rows of data before it
ought to go onto a new page - this can be adapted to any number).
We'll call your Packslip's Primary Key field InvoiceID, your query is called
QryPackslip and the items on your packslip have the Primary Keyfield ItemID
First we'll have a Counter field in the query to sequentially number the
Qury:
MyCounter=Dcount("[InvoiceID]","QryPackslip","[InvoiceID]<=" & [InvoiceID])
Then a field to group it in groups of 5.
MyGroup=(MyCounter + 5 - 1) \ 5
(note that the \ is a backsloping one, not the usual foreward slope)
The field will now say 11111,22222, 33333,44444, 55555, 66666 etc
Your packslip report must, presumably, have ForceNewPage for the InvoiceID
footer set to After Section
Your subreport is linked to the Main report by Invoice ID
Group by this MyGroup field in your subreport giving it a Footer.
Set the footer's Force New Page to After Section so that it sticks to 5
records to a page
Now just as I could taste success!!!!
It breaks up after 5 records alright BUT
on the first 'page' of each Invoice record, the subreport doesn't appear at
all, just neat little groups of 5 on the subsequent pages.
Why oh why!!!
I tried using Repeat Section in the Main report so that at least I could
start printing on the second page but it just got stuck in a loop and had to
be broken out of.
I'm sure there is some combination of forcing new pages and keeping groups
together that will do it, but what is it?
Evi
John B said:
I had to turn them off originally when I created the report. With them on,
they moved my other fields around that exist below the sub-report.
John
there
to