Repro
- Create a new query A in SQL view referencing a non-existing table: "SELECT * FROM doesnotexist;". Close A.
- Create a new report SR in design view, setting A as the record source. Close SR.
- Create a new report R in design view, adding SR as a subreport. Close R.
- Open the report with DoCmd.OpenReport "R", acViewPreview.
Expected behavior
An error is raised.
Actual behavior
No error is raised. The report opens and Access silently ignores the faulty query.
Note
An error is shown if the user opens report R manually by right-clicking on it and selecting "Preview". Thus, the behavior of DoCmd.OpenReport differs from opening the report via the UI.
Tested and reproduced with Access 2007 and 2016.