Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Order Data in a Graph


View products that this article applies to.

This article was previously published under Q209547
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

↑ Back to the top


Summary

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

↑ Back to the top


More information

To create a graph that shows all the orders in 1997, in descending order by order date (in the Orders table in the sample database Northwind.mdb), follow these steps:

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. In the Database window, click Queries, and then click New. Create the following new query in Design view, based on the Orders table, and then 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: Between #1/1/1997# And #12/31/1997#
  3. In the Database window, click Forms, and then click New, to create a new blank form in Design view that is not based on any table or query.
  4. On the Insert menu, click Chart, and then create a chart in the Detail section of the form. In the Chart Wizard dialog box, click the Queries option, and then select GraphQuery from the list of queries that is displayed. Click Next. In the next frame, move both fields to the Fields for Chart box, and then click Finish.
  5. On the View menu, click Form View. Note that the orders are sorted by the Ship Name field.
  6. On the View menu, click Design View. Click the graph. In the Graph property sheet, change the Row Source property to GraphQuery.
  7. On the View menu, click Form View. Note that the orders are now sorted in descending OrderDate order.

↑ Back to the top


References

For more information about Microsoft Graph properties, click Microsoft Access Help on the Help menu, type create a chart in a form or report in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

↑ Back to the top


Keywords: KB209547, kbinfo, kbhowto

↑ Back to the top

Article Info
Article ID : 209547
Revision : 2
Created on : 6/28/2004
Published on : 6/28/2004
Exists online : False
Views : 269