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.
- On the View menu, click Form View. Note that the orders are now sorted in descending OrderDate order.