Microsoft KB Archive/109323

= ACC: How to Create a Graph Bound to Two Combo Boxes (1.x/2.0) =

Article ID: 109323

Article Last Modified on 5/6/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q109323



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



SUMMARY
This article describes how to create a graph that is bound to two combo boxes. You can control the data that is displayed in the graph with your selections in the combo boxes.



MORE INFORMATION
The following example demonstrates how to set up a graph that is bound to two combo boxes:

 Start Microsoft Access and open the sample database NWIND.MDB.  Create the following query based on the Orders, Order Details, and Products tables:

      Query: QueryTest -      Field Name: Order Amount Table Name: Orders Total: Sum Field Name: Product Name Table Name: Products Total: Group By      Field Name: Category ID          Table Name: Products Total: Group By      Field Name: Year: CStr(NulltoZero(Year([Order Date]))) Table Name: Total: Group By                        Create a new form based on the QueryTest query. Choose Form Wizards. Select Graph, and then choose OK. Choose Next. Select SumofOrderAmount, and then choose ">". Select Product Name, and then choose ">". Select Category ID, and then choose ">". Choose Next.</li> Select Category ID, and then choose Next.</li> Choose Open to view the form in Form view.</li> View the form in Design view.</li> From the Layout menu, choose Form Hdr/Ftr.</li>  Add two combo boxes with the following properties to the form:

<pre class="fixed_text">      Object: Combo box -      ControlName: SelectCat RowSourceType: Table/Query RowSource: Categories

Object: Combo box -      ControlName: SelectYear RowSourceType: Value List RowSource: 1989;1990;1991;1992 </li>  Select the graph and modify the properties of its object frame as follows:

<pre class="fixed_text">      Object: Object Frame -      ControlName: Embedded0 LinkChildFields: Category Id;Year LinkMasterFields: SelectCat;SelectYear </li> View the form in Form view. Note that as you make different selections in the combo boxes, the contents of the graph change.</li></ol>

Keywords: kbhowto KB109323

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.