Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Access
Search
Search
 
Icon: Flag: (c) Microsoft
Get up to speed
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

A new technique for adding charts in Access
 
Applies to
Microsoft Office Access 2003
Microsoft Access 2002

In Access 2000 and earlier, you add a chart to a form or report by using the chart control (Microsoft Graph). Access 2002 provides a better technique for including charts in your forms and reports: You can embed a form that is open in PivotChart view as a subform in another form or report.

In Access 2002 or later, forms support two new views: PivotTable view and PivotChart view. PivotTable view uses the Office PivotTable Component to facilitate interactive data analysis. PivotChart view uses the Office Chart Component to help you create dynamic, interactive charts.

The following illustration shows a form in PivotChart view.

Form in PivotChart view

The following illustration shows the Categories form that displays sales details for each category in a chart.

Form with subform open in PivotChart view

Advantages of embedding a subform in PivotChart view:

  • PivotChart view supports more chart types and formatting options than the chart control.
  • Compared to using the chart control, it is easier to create record-bound (synchronized) charts by embedding a subform in a main form.
  • PivotChart view provides several tools, such as the field list and property sheet, to help you create a chart that meets your requirements.
  • If you need to write code to create and manipulate the chart, you will find it easier to use PivotChart view because the view's events and methods are integrated into the Access object model. The chart control is an external component and has its own object model.

For more information about how to design and format a PivotChart view, see Access Help.

Create a form or report that uses a subform in PivotChart view to display charts

ShowFirst, create the main form or report

  1. In the Database window under Objects, click Tables.
  2. Select the Categories table, click the arrow next to the New Object button on the toolbar, and then click AutoForm or AutoReport.
  3. On the View menu, click Design View.
  4. Delete all controls except the CategoryName and Description text boxes and their labels.
  5. Save and close the form or report.

ShowNext, create the subform

  1. In the Database window under Objects, click Queries.
  2. Select the Sales by Category query, click the arrow next to the New Object button on the toolbar, and then click AutoForm.
  3. On the View menu, click PivotChart View.
  4. Drag the Category Name field to the filter area.
  5. Drag the Product Sales field to the data area.
  6. Drag the Product Name field to the category area.
  7. Switch to Design view.
  8. In the form property sheet, set the Default View property to PivotChart.
  9. Save and close the form.

ShowFinally, embed the subform in the main form or report

  1. Open the main form or report in Design view.
  2. With the form or report open, drag the subform from the Database window and place it below the Description text box.
  3. Adjust the size of the subform as needed.
  4. Switch the main form or report to Form view or Print Preview.
Get Office 2007
Get Office 2007
advertisement