ACC: How to Order Data in a Graph

Last reviewed: May 14, 1997
Article ID: Q99934
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SUMMARY

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

This article describes how to order data in a graph more easily by changing the graph's RowSource property to a query name, rather than using the SQL statement that Microsoft Access generates.

MORE INFORMATION

The following steps demonstrate how to create a graph that will show all the orders after 12/31/94, in descending order, in the Orders table in the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0):

  1. Open the sample database Northwind.mdb.

  2. Create the following new query based on the Orders table, and save the query as GraphQuery:

          Query: GraphQuery
          ------------------------
          Type: Select Query
    

          Field: ShipName
    
             Table: Orders
             Show: True
          Field: OrderDate
             Table: Orders
             Sort: Descending
             Show: True
             Criteria: > #12/31/94#
    
          NOTE: In Microsoft Access 1.x and 2.0, there is a space in Ship Name
          and Order Date.
    
    

  3. Use the ChartWizard to create a new form based on GraphQuery. Select both fields for the graph and click Finish.

  4. Switch to Form view. Note that the orders are sorted by the Ship Name field.

  5. View the form in Design view. Select the graph. If it is not displayed, click Properties on the View menu to show the property sheet.

  6. Change the RowSource property of the object frame as follows:

          Object: Object Frame
          -----------------------------
          ControlName: Embedded0
    
             RowSourceType: Table/Query
             RowSource: GraphQuery
    
    

  7. Switch to Form view. Note that the orders are now sorted in descending OrderDate order.

REFERENCES

For more information about Microsoft Graph properties search the Help Index for "charts," and then "Chart Control Properties" or ask the Microsoft Access 97 Office Assistant.


Additional query words: queries graph wizards
Keywords : IntpGrph kbtool
Version : 1.0 1.1 2.0 7.0 97
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.