G
Guest
At what point are query parameters applied when nesting queries?
Due to the need to group/sum at multiple levels of data extraction, I often
create Query1, then use that as the source for Query2, which in turn is used
as the record source of a report.
The record source of the report must be filtered down to some subset of
records, however. Query1 has no criteria, so if it is run alone, it will pull
every record from the table. The same is true of Query2.
I am currently inserting the criteria into the RecordSource of the report.
The criteria is a reference to the contents of a combo box on the form from
which the user opens the report: [Forms]![myForm]![combo1]. This is where the
user chose the criteria.
Would it be it more efficient to enter the criteria into Query1, or does it
not matter? The advantage of inserting the criteria into the report is that I
can use my Query1 in other places in my application where the criteria may
come from a different place, so Query1 does not have to have a hard-coded
reference to the form involved.
Due to the need to group/sum at multiple levels of data extraction, I often
create Query1, then use that as the source for Query2, which in turn is used
as the record source of a report.
The record source of the report must be filtered down to some subset of
records, however. Query1 has no criteria, so if it is run alone, it will pull
every record from the table. The same is true of Query2.
I am currently inserting the criteria into the RecordSource of the report.
The criteria is a reference to the contents of a combo box on the form from
which the user opens the report: [Forms]![myForm]![combo1]. This is where the
user chose the criteria.
Would it be it more efficient to enter the criteria into Query1, or does it
not matter? The advantage of inserting the criteria into the report is that I
can use my Query1 in other places in my application where the criteria may
come from a different place, so Query1 does not have to have a hard-coded
reference to the form involved.