J
James & Darla Martin
Hello there,
I have a report that is grouped by Supplier + Zone. In each group there are
a list of Lots. So the report is something like this:
Supplier 1 - Zone 1
Lot 1
Lot 2
Lot 3
Supplier 1 - Zone 2
Lot 4
Lot 5
etc.
I also have a subreport in the group footer that needs to print one line for
each lot that appeared in that group. I've tried several methods to do this
and none of them are working.
Method 1
I linked the reports based on Supplier and Zone. The problem here is that
both the main report and the subreport are "filtered" to only print certain
lots for that supplier and zone (based on dates, lot number ranges, etc.). I
perform this filtering by setting the RecordSource appropriately in the
Report_Open event. However as soon as I link the report to the subreport via
the child/parent link, Access no longer lets me set the RecordSource in the
subreport.
Method 2
When I left the parent/child link in place and removed the filtering from
the OpenReport event of the subreport Access, of course, didn't filter the
records and printed more records in the subreport than in the main report.
Method 3
I then added LotNumber to the link between parent & child. The problem this
yielded was that now the subreport only printed for the last lot on the main
report.
Method 4
I scrapped the parent/child link altogether and went back to setting the
filter via RecordSource in the OpenReport event of the subreport. I set the
subreport's RecordSource to be the RecordSource of the main report but also
ensured that the Supplier's and Zone's were identical (via
SupplierID=Parenet.SupplierID and Zone=Parent.Zone). The problem here was
that it worked fine for the first group. But after that Access just repeated
the first group's subreport for each subsequent group. Putting a Stop in the
OpenReport event of the subreport confirmed that Access never only opened
the subreport once. I expected Access to open the subreport each time it got
to the group footer (since the subreport is in the group footer), but it
turns out that Access only opens it for the first group footer, although it
prints it for all of them.
Can anyone give me any suggestions?
Thanks in advance!
James
I have a report that is grouped by Supplier + Zone. In each group there are
a list of Lots. So the report is something like this:
Supplier 1 - Zone 1
Lot 1
Lot 2
Lot 3
Supplier 1 - Zone 2
Lot 4
Lot 5
etc.
I also have a subreport in the group footer that needs to print one line for
each lot that appeared in that group. I've tried several methods to do this
and none of them are working.
Method 1
I linked the reports based on Supplier and Zone. The problem here is that
both the main report and the subreport are "filtered" to only print certain
lots for that supplier and zone (based on dates, lot number ranges, etc.). I
perform this filtering by setting the RecordSource appropriately in the
Report_Open event. However as soon as I link the report to the subreport via
the child/parent link, Access no longer lets me set the RecordSource in the
subreport.
Method 2
When I left the parent/child link in place and removed the filtering from
the OpenReport event of the subreport Access, of course, didn't filter the
records and printed more records in the subreport than in the main report.
Method 3
I then added LotNumber to the link between parent & child. The problem this
yielded was that now the subreport only printed for the last lot on the main
report.
Method 4
I scrapped the parent/child link altogether and went back to setting the
filter via RecordSource in the OpenReport event of the subreport. I set the
subreport's RecordSource to be the RecordSource of the main report but also
ensured that the Supplier's and Zone's were identical (via
SupplierID=Parenet.SupplierID and Zone=Parent.Zone). The problem here was
that it worked fine for the first group. But after that Access just repeated
the first group's subreport for each subsequent group. Putting a Stop in the
OpenReport event of the subreport confirmed that Access never only opened
the subreport once. I expected Access to open the subreport each time it got
to the group footer (since the subreport is in the group footer), but it
turns out that Access only opens it for the first group footer, although it
prints it for all of them.
Can anyone give me any suggestions?
Thanks in advance!
James