Report and Subreport

N

Nick1966

Hi

I am having a problem with a report that contains a sub report. The main
report is sourced on a Query called LabSamples and the subreport is sourced
on a Query called SampleDetails. The relationship between LabSamples and
SampleDetails is one to many and the Master and Child fields are linked by
the LabNo field which exists in both tables / queries. On opening the Report
the user is prompted for a LabNo and the report is then opened, everything
appears fine, all the required data is shown, however on closer inspection
the report is producing a page for each sample

i.e. If a LabNo has 10 samples then the exact same data is shown on 10 pages
when it should just be one page. I have tried changing the Master and Child
fields to LabNo and SampleDetailID but this still produces a 10 page report
with 1 sample on each page.

If anyone has any ideas on where I have gone wrong I would be pleased to
receive them. I hope the explanation is clear.

Thanks


Nick


PS I am using Access 2000
 
S

Steve Schapel

Nick,

Have a look at the query that the report is based on. You may have to
make it DISTINCT... for example, right-click anywhere on the background
of the top panel of the query design window, select Properties from the
popup menu, and then set the Unique Values property to Yes.

In any case, a report/subreport structure is probably not the best
approach. I would recommend making a single report, based on a query
that includes both tables and returns all the data you want, and then
use the Sorting & Grouping facility of the report to get your LabSample
in a LabSample Header section, and group the SampleDetails accordingly.
 

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