multiple subreports with limits on the number of records per page

A

aarondorsey

Hello!

I have a report that contains three subreports. One subreport has an
aggregate query. To limit the number of records per page on the
aggregate report, I store the recs from the aggregate query into a temp
table, then use another query with a dCount to set page numbers.

query set1:
SELECT hwtrak1.no, sum(hwtrak1.lbs) as lbssum, max(hwtrak1.pkup) as
pkdate WHERE hwtrak1.no = pro1.no1 GROUP BY hwtrak1.no

query testInsert:
INSERT INTO temp SELECT * FROM set1

query testCalcPageNumber:
SELECT temp.ID, temp.no, temp.lbs, temp.pkup, Dcount("*","temp","ID<" &
[ID])\6 AS pageNumber FROM temp


In the Detail of my Subreport, I have a counter and a pagebreak and:

Private Sub Detail_Format
If Report_set1.TheCounter Mod 6 = 0 Then
Report_set1.PageBreak.Visible = True
Else
Report_set1.PageBreak.Visible = Fals
End If
End Sub

The Subreport's Record Source is testCalcPageNumber

This shows six records per page like it should.


The problem is that the only way I can limit the records per page in
the Main report (with the subreport in the Detail) is by setting its
Record Source to:

SELECT testCalcPageNumber.pageNumber
FROM testCalcPageNumber
GROUP BY testCalcPageNumber.pageNumber

So that works for one subreport...

How can I limit all three subreports on the Main report?


Many Thanks,

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top