ACC1x: How to Format a Label for Each Axis of a Graph (1.x)

Last reviewed: February 23, 1998
Article ID: Q99398
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1
  • Microsoft Graph versions 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:

   ARTICLE-ID: Q147193
   TITLE:      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

  1. Open the sample database NWIND.MDB. In the Database window, select the Orders table.

  2. On the menubar, choose the Forms button to create a new form.

  3. Choose Form Wizards. Select Graph, and then choose OK.

  4. To accept the defaults, press Next when the following message appears: "Which type of graph do you want?"

  5. Select the Order Date field from the Available Fields list and choose the right arrow to add it to the Fields for Graph list.

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

  1. Switch to Design view. Select the chart object and display the property sheet.

  2. Place your insertion point in the RowSource property and press SHIFT+F2 to open the Zoom window.

  3. Highlight the entire SQL Statement to select it. Press CTRL+C to copy it to the Clipboard.

  4. Create a new query by choosing the Query button on the menubar.

  5. From the View menu, choose SQL.

  6. Highlight all the text in the SQL dialog box to select it. Press CTRL+V to replace the existing text with the Clipboard contents.

  7. Choose OK. The fields [Order Date] and [Order Amount] are placed in the query grid.

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

  9. Switch to Design view. Copy the contents of the SQL dialog box to the Clipboard.

  10. Return to the form. Select the chart object and paste the contents of the Clipboard into the RowSource property.

  11. 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 : RptLabel kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : x86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 23, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.