Unanswered: get query parameter down to subordinate query
Is there some reasonable way to expose a query parameter to a subordinate query?
Here's my problem (simplified)â€¦
I have a master table, tblMaster, which links to a number of other tables. One of the related tables, tblAsynch, records date stamped events. Another, tblQuarterly, tracks data that occurs quarterly. In doing quarterly reporting, I want to report fields from the three tables. I have a dialog form to accept report parameters, including the quarter being reported.
For tblAsynch, I want just the last record prior to the end of the quarter. I can get the absolute last record either by doing an aggregate query and using the "last" function, or by doing a query containing a subquery to return just the last record for each master. But to get the last record before an enddate, I have to get that parameter down to the subordinate query.
I don't want that query to know the name of the dialog form, as I'd like to be able to use the query elsewhere.
Is there a way to expose a field in the top-level query to be used as a parameter by the subordinate query?