Limit Records Subreport

M

Michael

Hi Folks - I have report/subreport situation. The main report lists teacher
information and the subreport lists the classes they teach. On the first
page of the report, I want the subreport to list only 3 classes. On the
second page of the report (I added a page break), I want to display the rest
of the classes. So, if a teacher has 10 classes, the first 3 classes would
be on the first page and classes 4-10 would be on the second page.

So far, I have placed a subreport on page one and a subreport on page two. I
know I can modify the top values parameter for the first page subreport to
limit the classes to 3, but I'm stuck with displaying classes 4-10 on the
second subreport. Any ideas?

Thanks,

Michael
 
R

Roger Carlson

As for displaying 4-10, you can use your Top query as a subquery to restrict
those values. For instance, suppose you had the following Top query:

Select Top 3 *
from Classes
Order By ClassID

You could use that as a subquery like so:

Select *
from Classes
where ClassID Not In
(Select Top 3 ClassID
from Classes
Order By ClassID)
Order By ClassID

Notice, that when I use it as a subquery, I don't use the *, but list ONLY
the field that the query is ordered by.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Similar Threads


Top