Microsoft Knowledge Base Email Alertz

The Microsoft Access Chart Wizard enables you to format a label for each axis of a chart or graph. You can modify the label formats in Microsoft Graph, and then save those changes for later use. When it is not possible to simply reformat the data in

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 208515 - Last Review: June 28, 2004 - Revision: 2.1

ACC2000: How to Format a Label for Each Axis of a Graph

This article was previously published under Q208515
Moderate: Requires basic macro, coding, and interoperability skills.

On This Page

SUMMARY

The Microsoft Access Chart Wizard enables you to format a label for each axis of a chart or graph. You can modify the label formats in Microsoft Graph, and then save those changes for later use. When it is not possible to simply reformat the data in Microsoft Graph, you should apply the formatting you want before the information is sent to the chart.

MORE INFORMATION

When a chart is created, the nature of the chart and/or the type of grouping may require a temporary modification of the data that is sent to the chart.

This modification takes place in the SQL statement that is generated for the chart by the Chart Wizard. In the example cited for this article, a Date field is converted to an integer number using the Year() function. Because this data is no longer a Date data type, it cannot be formatted using the available Date formats.

When a chart is created using the Chart Wizard, a SQL statement is built. This statement is placed in the RowSource property of the chart object. Each time the form or report in which the chart resides is refreshed, the SQL statement is re-run, and the results are sent to Microsoft Graph.

How to Change the Format of the Labels in a Chart

To change the format of the labels in a chart, follow these steps:
  1. Open the sample database Northwind.mdb.
  2. On the Insert menu, click Form.
  3. In the New Form dialog box, click Chart Wizard, select the Orders table in the Choose the table....comes from list box, and then click OK.
  4. In the Chart Wizard dialog box, under Available Fields, select the OrderDate field, and then add it to the Fields for Chart list.
  5. Repeat step 4 for the Freight field, and then click the Next button two times to accept the defaults.
  6. Double-click the X-Axis label OrderDate by month.
  7. In the Group dialog box, click Year, and then click OK.
  8. Click Finish. Note that the labels for the axes are 1996, 1997, 1998, and 2000.

Changing the Label Format

  1. On the View menu, click Design View.
  2. Select the chart. If the property sheet is not displayed, on the View menu, click Properties.
  3. Right-click the RowSource property, and then click Build on the shortcut menu.
  4. Change the Year([OrderDate]) field to Format([OrderDate],"YY").
  5. Run the query to verify that the years in the OrderDate column are formatted as follows: 96, 97, 98, 00.
  6. Close the query, and then save the changes.
  7. Switch the form to Form view. Note that the labels of the axes are now formatted as: 96, 97, 98, 00.

REFERENCES

For more information about editing charts, click Microsoft Access Help on the Help menu, type edit a chart in a form or report in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
  • Microsoft Graph 2000
Keywords: 
kbhowto kbinfo KB208515
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate