ACC: How to Create a Graph Bound to Two Combo Boxes (1.x/2.0)
ID: Q109323
|
The information in this article applies to:
-
Microsoft Access versions 1.0, 1.1, 2.0
SUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
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.
- Select Category ID, and then choose Next.
- Choose Open to view the form in Form view.
- View the form in Design view.
- From the Layout menu, choose Form Hdr/Ftr.
- Add two combo boxes with the following properties to the form:
Object: Combo box
-----------------------------
ControlName: SelectCat
RowSourceType: Table/Query
RowSource: Categories
Object: Combo box
---------------------------------
ControlName: SelectYear
RowSourceType: Value List
RowSource: 1989;1990;1991;1992
- Select the graph and modify the properties of its object frame as
follows:
Object: Object Frame
-----------------------------------------
ControlName: Embedded0
LinkChildFields: Category Id;Year
LinkMasterFields: SelectCat;SelectYear
- View the form in Form view. Note that as you make different selections
in the combo boxes, the contents of the graph change.
Keywords : kbtool IntpGrph
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbhowto
|