ACC2000: How to Order Data in a Graph (209547)



The information in this article applies to:

  • Microsoft Access 2000

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

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.

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.

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.

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kbhowto kbinfo KB209547