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

Last reviewed: May 14, 1997
Article 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:

  1. Start Microsoft Access and open the sample database NWIND.MDB.

  2. 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
    
    

  3. Create a new form based on the QueryTest query. Choose Form Wizards.

  4. Select Graph, and then choose OK.

  5. Choose Next.

  6. Select SumofOrderAmount, and then choose ">". Select Product Name, and then choose ">". Select Category ID, and then choose ">". Choose Next.

  7. Select Category ID, and then choose Next.

  8. Choose Open to view the form in Form view.

  9. View the form in Design view.

  10. From the Layout menu, choose Form Hdr/Ftr.

  11. 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
    
    

  12. 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
    
    

  13. View the form in Form view. Note that as you make different selections in the combo boxes, the contents of the graph change.


Keywords : IntpGrph kbtool
Version : 1.0 1.1 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.