Microsoft KB Archive/209547

= ACC2000: How to Order Data in a Graph =

Article ID: 209547

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



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.

 Start Microsoft Access and open the sample database Northwind.mdb. 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#

 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. 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. On the View menu, click Form View. Note that the orders are sorted by the Ship Name field. On the View menu, click Design View. Click the graph. In the Graph property sheet, change the Row Source property to GraphQuery.</li> On the View menu, click Form View. Note that the orders are now sorted in descending OrderDate order.</li></ol>

<div class="references_section">