
filtering subreports based on main report fields
You have to link the sub report to the main report.
on the data properties of you subreport (while you are on the main report)
make sure you pick the link.childfields and link.master fields to the
mrimary key on your main report and the one on your subreport. Once you do
this, you will only get the records on your subreport related to the record
of your main report.
Rodrigo.
Quote:
> I have a subreport that has pages and pages of data. The subreport was
> placed in the sub_id footer section of the main report. I have an
> invisible field called primary_id displayed in this footer for the main
> report. I would like to filter the subreport to only show records where
> the subreports field also called primary_id is equal to the current
> value of the primary_id from the main report.
> I tried setting the filter on the subreport to:
> [primary_id] = reports![rolled_new]![primary_id]
> But when I do this the subreport just shows up as blank. The first
> record of the main report has an primary_id of 19. If I hardcode the
> filter to say [primary_id] = 19. Then when I run the main report I see
> five records in the subreport.
> I hope it is clear what I am trying to do. Does anyone know a good way
> to do this?
> Thanks for your help.