How to display one decimal places for percentages in graph data ta

  • Thread starter Jayashree Krishna
  • Start date
J

Jayashree Krishna

I Want to display one decimal places for percentages in graph data table of
Access 2000. Presently , if percentage symbol is displayed in the graph

data,then I was able to display only two decimal places even
thought the source query is formatted to display one decimal places.

Example : I want to display 7.8% for the number 0.0776 in the
table say temp1. I am using the following query in my chart as the row source.

SELECT temp1.StkdRange AS StkdRange,
Format((Sum([temp1].[StkdRangePercent])),"0.0%") AS Ocean
FROM temp1 GROUP BY temp1.StkdRange, temp1.Mode, temp1.SortKey

I am getting the result as follows
-11 -10 -9 -8 -7
0.10% 0.20% 7.50% 4.30% 2.50%

Instead of getting the result
-11 -10 -9 -8 -7
0.1% 0.2% 7.5% 4.3% 2.5%

One additional zero is displayed after the numbers.
Any help is appreciated
 
J

Jayashree Krishna

Hi,

just now got the answer from the thread with subject as "Cannot format data
in data table". I got the correct answer from the website
http://ourworld.compuserve.com/homepages/attac-cg/

The solution is have the following code in the section print event for each
graph.

On Error Resume Next
Dim objGraph As Object
Dim objDS as Object
Set objGraph = Me!TheNameOfYourGraph.Object
Set objDS = objGraph.Application.DataSheet
'Singe decimal place, 200 data points
'Format is the same as Excel VBA
objDS.Range("A1:A200").NumberFormat = "#.0%"
objGraph.Refresh
DoEvents
Set objGraph = Nothing

Halleluiah!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top