Have multiple subreports display entries only once

  • Thread starter Thread starter David K.
  • Start date Start date
D

David K.

I've checked out some posts related to my problem but I'm just not getting it.

I've created two tables to record non conformances of parts made at our
company. The main table (tbl_NCMain) stores the basic job info such as
customer, PO #, part number, qty made, qty rejected, etc. The secondary
table (tbl_NCDetails) stores the specific defects that were discovered among
a batch of parts.

The tables are set up with a one-to-many relationship and related by the
NCNumber field. This way, one NCR may have only one type of defect or it may
contain several.

My problem is getting my report to display properly. It is currently set up
to display one NCR at a time using a filter and the Where code in VB. That
is working fine. I want to display each defect detail only once and I would
like to have up to three subreports displaying info in what I presume would
be the Detail section of the report.

I got it to work once but when I closed the program and came back the next
day the report was showing every DefectDetail entry (as planned) but also
showing the subreport the same number of times as there were numbers of
detail entries. Can't figure out how I did it originally. Make sense? I'll
show an example:

First, what I would like...

Page Header (everything works great here)

Under Detail Section
Defect #1 Dimensional Length is short by .012"
Defect #2 Plating Vendor plated parts with the incorrect
coating

Now, what I ended up with...

Page Header (everything works great here)

Under Detail Section
Defect #1 Dimensional Length is short by .012"
Defect #2 Plating Vendor plated parts with the incorrect
coating

Defect #1 Dimensional Length is short by .012"
Defect #2 Plating Vendor plated parts with the incorrect
coating

The subreport would repeat the same number of times as there were entries.
If I put it 6 types of defects then the report would show the subreport 6
times which is not what I want.

Any of this make sense? Do you need more info from me?
 
You did not say how you were feeding the subreport.
Are you using a query that has the one-to-many tables joined?
And the Master/Child links set using the primary key of the 'one' table?
 
Karl,

I created a query based on the two tables that are joined one-to-many.
I then inserted that query into my form which subsequently/automatically
created a subform.
In the detail section of my report, I inserted the query (mentioned above)
which subsequently/automatically created a subreport. Yes, the Master/Child
links are set to the primary key of the 'one' table.

I then entered in a test example into my form and put in 6 different types
of defects discovered on a batch of parts.

When I print preview my report the subreport still shows up 6 times.
Perhaps I should start completely fresh starting with new tables.
 
I then entered in a test example into my form and put in 6 different types
How is this form connected to the rest of it?
The 6 types and 6 copies are related. If you put 3 types I am sure you will
get 3 copies of subreport.
 
Karl,

Your questions actually helped me figure out how to make it work but I'm too
much of a rookie to explain how I did it. I can't even answer your questions
properly. I'll do it again and write down the steps in case someone else has
a similar problem.

Thanks,
 
Back
Top