none
Bug report: Errors in subreport data sources are silently ignored by DoCmd.OpenReport RRS feed

  • General discussion

  • Repro

    1. Create a new query A in SQL view referencing a non-existing table: "SELECT * FROM doesnotexist;". Close A.
    2. Create a new report SR in design view, setting A as the record source. Close SR.
    3. Create a new report R in design view, adding SR as a subreport. Close R.
    4. 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.



    • Edited by Heinzi.at Friday, June 24, 2016 8:28 AM
    Friday, June 24, 2016 8:27 AM