ACC1x: How to Simulate Changing RecordSource Property of Report

Last reviewed: May 14, 1997
Article ID: Q102672
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SUMMARY

Although you cannot actually change the RecordSource property of a report, you can simulate the change by using a OpenReport macro action and calling a different query source from the Filter Name argument.

MORE INFORMATION

The Filter Name argument must reference a query that contains the same number of fields (with the same names) as appear in the existing report. If the fields do not exist in the query, the report may display the "#Name?" error message for controls bound to those fields.

To simulate changing the RecordSource property of a report called MyReport, do the following:

  1. Create a new report called MyReport.

  2. Create a new query called MyNewQuery, using the same fields that appear in MyReport.

  3. Create a macro with one action as follows:

          OpenReport
          -----------------------
          Report Name: MyReport
          View: Print Preview
          Filter Name: MyNewQuery
    

    NOTE: A SQL statement cannot be substituted for the query name.

Using this method, you can use the same report to print data from multiple data sources.

REFERENCES

Microsoft Access "User's Guide," version 1.0, Chapter 23


Keywords : kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.