ACC1x: How to Format a Label for Each Axis of a Graph (1.x)
ID: Q99398
|
The information in this article applies to:
-
Microsoft Access versions 1.0, 1.1
-
Microsoft Graph, version 3.0
SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.
The Microsoft Access Graph Wizard does not give users the option to format
a label for each axis of the graph. You can modify the labels in Microsoft
Graph, but this change is not permanent. The next time the graph is
updated, the formatting is lost.
This article describes the steps to change the format permanently by
modifying the information that Microsoft Access sends to Microsoft Graph.
For information on this subject in later versions of Microsoft Access,
please see the following article in the Microsoft Knowledge Base:
Q147193 ACC: How to Format a Label for Each Axis of a Graph
MORE INFORMATION
When a graph is created using Graph Wizard, a SQL statement is built. This
statement is placed in the RowSource property of the graph object. Each
time the form or report in which the graph resides is refreshed, the SQL
statement is re-executed and the results are sent to Microsoft Graph.
This SQL statement can be modified by the user. We recommend that you copy
it to a new query, where you can test your changes.
The example below describes the steps to change the format of the labels in
a graph:
Procedure A - Create the Graph
- Open the sample database NWIND.MDB. In the Database window, select the
Orders table.
- On the menubar, choose the Forms button to create a new form.
- Choose Form Wizards. Select Graph, and then choose OK.
- To accept the defaults, press Next when the following message appears:
"Which type of graph do you want?"
- Select the Order Date field from the Available Fields list and choose
the right arrow to add it to the Fields for Graph list.
- Repeat step 5 for Freight, then choose Next twice to accept the default
(Group [Order Date] by: Year). Choose Open. Note that the labels for the
axes are: 1989, 1990, 1991, 1992
Procedure B - Changing the Label Format
- Switch to Design view. Select the chart object and display the property
sheet.
- Place your insertion point in the RowSource property and press SHIFT+F2
to open the Zoom window.
- Highlight the entire SQL Statement to select it. Press CTRL+C to copy
it to the Clipboard.
- Create a new query by choosing the Query button on the menubar.
- From the View menu, choose SQL.
- Highlight all the text in the SQL dialog box to select it. Press
CTRL+V to replace the existing text with the Clipboard contents.
- Choose OK. The fields [Order Date] and [Order Amount] are placed in
the query grid.
- Change the field Year([Order Date]) to Format([Order Date],"YY").
Execute the query to verify that the years in the Order Date column are
formatted as follows: 89, 90, 91, 92.
- Switch to Design view. Copy the contents of the SQL dialog box
to the Clipboard.
- Return to the form. Select the chart object and paste the
contents of the Clipboard into the RowSource property.
- Switch to Form view. The labels of the axes should now read as
follows: 89, 90, 91, 92.
REFERENCES
For more information about using SQL statements in the Rowsource property,
search for "menus: Query Window" then "Query commands," and then "View
menu" under Design View using the Microsoft Access Help menu.
For more information about using Graph Properties, search for "graph
control properties" using the Microsoft Access Help menu.
Additional query words:
ole embed requery label
Keywords : kbusage RptLabel
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbhowto
|