Unanswered: Dynamic Pass-through Queries and Sub-Reports
I have a report based on data from a passthrough query, which contains a sub-report also based on remote data. The sub-report OnOpen procedure opens the parent report's query and uses that to dynamically filter its own data by forming a new SQL statement (for example iterating throught the recordset and creating a "WHERE id IN (1,2,3,4)" filter.
This has to be done because the table/view the sub-report is based on is huge, and Access can be really naive in the way it joins the parent/child reports, transferring massive amounts of data to the local machine to perform the join.
So the RecordSource for the sub-report includes all the data needed for all records in the parent report, and if it is not linked to the parent data using 'Link Child/Parent Fields' then it prints the whole query out for each parent record (as expected).
However - if the sub-report is now linked (e.g. 'Link Child Fields' = 'parent', 'Link Parent Fields' = 'id') then the sub-report is suddenly blank for all parent records.
What went wrong? The sub-report and parent report definitely contain the fields used in the link, and there is definitely data that should be displayed (I can monitor the pass-through queries used, and they are accurate and efficent).