Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change legend values in chart

Status
Not open for further replies.

Newbie456

Technical User
Nov 21, 2005
37
US
I apologize if this has already been addressed - I need things spelled out a little more obviously. I'm a paleontologist, not a programmer!

I posted this thread awhile ago, didn't understand the answer, and just got back to it...

I have a pie chart based on a yes/no value. When I build the chart it displays 0 and -1, which I want to change to text values anyone can understand.

Please help!
 
Please find and reply back with the Row Source property of your chart control. This should be something like:

SELECT ... FROM ...

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
My Row Source is:

SELECT [Battering],Sum([SumOfCount]) AS [SumOfSumOfCount] FROM [mano material types] GROUP BY [Battering];

Battering is the yes/no field (either battered or not).
 
Change the Row Source to something like:
Code:
SELECT IIF([Battering],"True Text Value","False Text Value") As Battering, Sum([SumOfCount]) AS [SumOfSumOfCount] 
FROM [mano material types]   
GROUP BY IIF([Battering],"True Text Value","False Text Value");

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
That give me the error

"Circular reference caused by alias 'battering' in query definition's select list"

Perhaps if I knew where this logic is headed.. don't I need to input somewhere what I would like it to say?
 
You need to switch the value of Battering from 0 and -1 to something else with an expression. You have never specified "text values anyone can understand" which you want in place of -1 and 0.
Code:
SELECT IIF([Battering],"True Text Value","False Text Value") As Batter, Sum([SumOfCount]) AS [SumOfSumOfCount] 
FROM [mano material types]   
GROUP BY IIF([Battering],"True Text Value","False Text Value");


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Here's a simpler answer to my own problem, in case anyone else is interested:

Date: October 2nd, 2007
Blogger: Mary Ann Richardson
Category: Microsoft Office, Access, Tips
Tags: Microsoft Access, Insurance, Life Insurance, Mary Ann Richardson

1 comment(s) Email Save Print Digg This Recomend 12
Check boxes are fine for data entry, but you may not want to use them on a formal report. For example, suppose you have a Yes/No field in your Employee Records table called Insurance. If the employee signed up for your company’s life insurance plan, the box is checked; if the employee declined the insurance, the box is not checked. You want to create a report that lists employee name, ID, hire date, and whether the employee declined or accepted life insurance. Follow these steps:

Create a query that displays Employee ID, Lastname, Firstname, Hire Date, and Insurance field from the Employee Records table.
Right-click the Insurance field in the Query Design view and select Properties.
Click in the Format property box and enter the following code:
;"Accepted";"Declined"Click the Lookup tab.
Click in the Display Control property box and select Text Box.
Close and save the query.
When you create a report based on this query, either the word Accepted or Declined will replace the check box in the Insurance field.


Whew!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top