ACC: Set the RowSource Property of a Report Graph DynamicallyLast reviewed: August 29, 1997Article ID: Q158927 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article discusses how to set the RowSource property of a graph object in a Microsoft Access report programmatically.
MORE INFORMATIONIf you try to set the RowSource property of a graph object on a report in Print Preview, you may receive the following error message.
Microsoft Access 7.0 and 97
You can't set the Row Source property after printing has started. Microsoft Access 2.0
Can't set property 'Row Source' after printing has started.You must open the report in Design view first, set the RowSource property of the graph object, and then print or view the report. In the following example, you create a macro to open a report in Design view, set the RowSource property of a graph, and then display the report in Print Preview. Then the macro is attached to a command button on a form to dynamically change the contents of the graph based on the current record on the form. CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (or NWIND.MDB in Microsoft Access 2.0). You may want to back up the Northwind.mdb (or NWIND.MDB) file and perform these steps on a copy of the database.
Creating the Graph Report
Creating the Macro
Adding the Macro to a Button on a Form
REFERENCESFor more information about the RowSource property, search the Help Index for "RowSource property," or ask the Microsoft Access 97 Office Assistant. Keywords : AutoGrph kbinterop kbprg PgmHowTo IntpGrph Version : 2.0 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |