[AccessD] Filtering Passthrough Query for Subreport

David Emerson newsgrps at dalyn.co.nz
Sat Oct 17 20:17:42 CDT 2015


Taking up Bill and Jim's excellent advice I am going back to basics and have
started afresh.  Here is where I am at:

I have a report which displays information for a single client. It has a
subreport with several records for claims.  Each claim may have several
packages so there is a subreport in the Claims subreport for packages. 

Just prior to opening the report I create the passthrough queries and use
the client ID to get all claim, and package records for the client. 

The Claim query is called qryTempQuery3.  It returns all claims for the
client and includes a field called ClaimID.
The package query is called qryTempQuery4. It returns all packages for all
claims and included a field called ClaimIDNo which links packages to the
claim record.
I have checked the results of these queries and the records are showing
correctly.

In the Claims Subreport I have made the Recordsource qryTempQuery3.
In the Packages Subreport (which is a subreport in the Claims subreport) I
have made the Recordsource qryTempQuery4.

In the Claim Subreport object I have set the Link Master Fields property to
ClaimID, and the Link Child Fields property to ClaimIDNo

When I run the report for a client I get the Claims subreport repeating for
every claim but I do not get any records showing for the packages.

If I remove the Link Master Field and Link Child Field properties then the
reports run and all the package records appear under each claim.

If I had any hair left I would be tearing it out by now.

Regards

David

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim
Dettman
Sent: Sunday, 18 October 2015 1:33 a.m.
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Filtering Passthrough Query for Subreport


David,

  Unless I'm missing something, it's sounds like your trying to over think
this.

  Simply set the sub reports record source to the base query, then set the
master/child links as appropriate.

  The sub reports will requery as the main report record changes.

Jim. 




More information about the AccessD mailing list