ACC97: Graph 97 Chart Object Does Not Update Display Correctly

ID: Q165836


The information in this article applies to:
  • Microsoft Access 97


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you add a graph to a report and link its data to a field in the report, the graph is not updated from one record to the next when you view or print the report.


CAUSE

Microsoft Access 97 is not requerying the LinkChildFields and LinkMasterFields properties in the chart object.


RESOLUTION

If the graph is based on a saved query, open that query in Design view; add the field displayed in the LinkMasterFields and LinkChildFields properties of the graph to that query.

If the graph is based on an SQL statement, move the field in the LinkMasterFields and LinkChildFields properties of the graph to a field with a WHERE clause in the graph's RowSource property. The following example uses the Sales By Category report in the sample database Northwind.mdb to show you how to do this.

CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.

  1. Start Microsoft Access 97 and open the sample database Northwind.mdb.


  2. Open the Sales By Category report in Design View.


  3. If the properties sheet is not already displayed, click Properties on the View menu.


  4. Select the graph in the CategoryName Header section of the report.


  5. Note that the graph's LinkChildFields property is set to CategoryID; this will become a new field in the graph's RowSource. Note that the graph's LinkMasterFields property is also set to CategoryID; this will be used as a WHERE clause in the graph's RowSource.


  6. Clear the LinkChildFields and LinkMasterFields properties.


  7. Using the right mouse button (right-click), click the graph's RowSource property, and then click Build on the shortcut menu that appears.


  8. In the Query Builder, drag the CategoryID field to the QBE grid. This represents the LinkChildFields property.


  9. Change the Total row of the CategoryID field from Group By to Where, and then type the following expression in the Criteria row:

    Reports![Sales by Category]![CategoryID]

    This represents the LinkMasterFields property.


  10. Close the Query Builder window and save the changes.


  11. Save the Sales By Category report, and then close it.


  12. Preview the Sales By Category report and note that the information in the graph corresponds to the Product and Sales data on each page of the report.



STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97.

If the graph is based on an SQL statement, this behavior does not occur in Microsoft Access 97 Service Release 1. However, if the graph is based on a saved query and you are using Microsoft Access 97 Service Release 1, you must still add the field shown in the LinkChildFields and LinkMasterFields properties of the graph to the query.

NOTE: To update your copy of Microsoft Access 97 to Service Release 1, download Microsoft Office Service Release 1 from Microsoft's Web site at the following address:

http://officeupdate.microsoft.com/Articles/sr1fact.htm


MORE INFORMATION

Steps to Reproduce Problem


  1. Start Microsoft Access 97 and open the sample database Northwind.mdb.


  2. Open the Sales By Category report in Design view.


  3. If the properties sheet is not already displayed, click Properties on the View menu.


  4. Select the graph object, and then clear its LinkChildFields and LinkMasterFields properties.


  5. On the File menu, click Print Preview. Note that the graph displays information for all products on each page of the report.


  6. On the View menu, click Design view.


  7. Select the graph object and reset its LinkChildFields and LinkMasterFields properties to CategoryID.


  8. On the File menu, click Print Preview. Note that the information in the graph corresponds to the Product and Sales data on each page of the report.


  9. Save the report and close it.


  10. Preview the Sales By Category report from the Database window. Note that the graph still displays information for all products on each page of the report, just as it did when you cleared the graph's LinkChildFields and LinkMasterFields properties.



REFERENCES

For more information about the LinkChildFields and LinkMasterFields properties, search the Help Index for "LinkChildFields property" or "LinkMasterFields property."

Keywords : kbui IntpGrph RptOthr
Version : 97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: April 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.