ACC97: Graph 97 Chart Object Does Not Update Display Correctly
ID: Q165836
|
The information in this article applies to:
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.
- Start Microsoft Access 97 and open the sample database Northwind.mdb.
- Open the Sales By Category report in Design View.
- If the properties sheet is not already displayed, click Properties on
the View menu.
- Select the graph in the CategoryName Header section of the report.
- 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.
- Clear the LinkChildFields and LinkMasterFields properties.
- Using the right mouse button (right-click), click the graph's RowSource
property, and then click Build on the shortcut menu that appears.
- In the Query Builder, drag the CategoryID field to the QBE grid. This
represents the LinkChildFields property.
- 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.
- Close the Query Builder window and save the changes.
- Save the Sales By Category report, and then close it.
- 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
- Start Microsoft Access 97 and open the sample database Northwind.mdb.
- Open the Sales By Category report in Design view.
- If the properties sheet is not already displayed, click Properties on
the View menu.
- Select the graph object, and then clear its LinkChildFields and
LinkMasterFields properties.
- On the File menu, click Print Preview. Note that the graph displays
information for all products on each page of the report.
- On the View menu, click Design view.
- Select the graph object and reset its LinkChildFields and
LinkMasterFields properties to CategoryID.
- 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.
- Save the report and close it.
- 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