D
Don
(This is an extension of my post "Data Source for a Sub-Report" I posted on
Sunday, 21 February.)
After pondering my problem a bit more, I generalized to the case of
displaying 1-to-many data sets. Is there a preferred approach to displaying
data generated from a single query which has a 1-to-many form? Or is this
type of query bad to begin with?
As a somewhat contrived example to demonstrate this question, consider an
apartment building management system. The building owner might want a
report of all renters (and dates of occupancy) for each apartment. (As the
building has been around for some time and there is a high turnover rate,
each apartment has had several tenants. And there are a lot of Smiths in
this town as it is Smithville.) The building owner now wants a report (in
the same format as the one described earlier) which lists all the residents
named "Smith" who have lived in each apartment on the third floor of the
building. Obviously, this requires a query looking at not only the
apartment table, but the resident table. Not a big stretch. However, how
does one set up the report (or form)? The query provides all the data, but
the report/sub-report format assumes the sub-report is pulling in data from
a separate table or query.
Is there a way to tell the sub-report to use the query used in the report?
Is there a way to dynamically pass a (SQL) query to the sub-report? Is
there a better way to approach this problem?
Thanks!!
Don
Sunday, 21 February.)
After pondering my problem a bit more, I generalized to the case of
displaying 1-to-many data sets. Is there a preferred approach to displaying
data generated from a single query which has a 1-to-many form? Or is this
type of query bad to begin with?
As a somewhat contrived example to demonstrate this question, consider an
apartment building management system. The building owner might want a
report of all renters (and dates of occupancy) for each apartment. (As the
building has been around for some time and there is a high turnover rate,
each apartment has had several tenants. And there are a lot of Smiths in
this town as it is Smithville.) The building owner now wants a report (in
the same format as the one described earlier) which lists all the residents
named "Smith" who have lived in each apartment on the third floor of the
building. Obviously, this requires a query looking at not only the
apartment table, but the resident table. Not a big stretch. However, how
does one set up the report (or form)? The query provides all the data, but
the report/sub-report format assumes the sub-report is pulling in data from
a separate table or query.
Is there a way to tell the sub-report to use the query used in the report?
Is there a way to dynamically pass a (SQL) query to the sub-report? Is
there a better way to approach this problem?
Thanks!!
Don