Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2009, 10:51 AM
Authorized User
Points: 216, Level: 4
Points: 216, Level: 4 Points: 216, Level: 4 Points: 216, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default Access Pie Chart driving me crazy

Hi all,

I am trying what I would think is pretty basic but I can't figure it out. I have one yes/no in a table that I want to display in a pie chart. I want to show all the yes and all the no's. I have created a query that counts the yesses and nos so that should populate the pie chart. I just can't figure out how to display this and like the title says it is driving me crazy. Any help would be greatly appreciated.

Thanks,
Chris
Reply With Quote
  #2 (permalink)  
Old January 13th, 2009, 04:52 AM
Authorized User
Points: 216, Level: 4
Points: 216, Level: 4 Points: 216, Level: 4 Points: 216, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Angry

Okay can somebody anybody please please help. I am getting desperate and have spent about a whole day researching and can't figure this out. I am begging anyone to help me.
Reply With Quote
  #3 (permalink)  
Old January 13th, 2009, 09:27 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is what I did.

I created a table with a Yes/No field, and populated it with sample data.

I then created a query that looks like this:

Query1:
SELECT Count(Table1.SampleID) AS CountOfSampleID, Table1.YesOrNo
FROM Table1
GROUP BY Table1.YesOrNo;

This grouped the Yes and No responses and gave me the following output in the query:

CountOfSampleID YesOrNo
5 Yes (checkbox)
3 No (checkbox)

I then created a report in Design View, and inserted a chart in the Detail Section:

Insert > Chart > Queries > Query1 > both fields > Pie Chart > Next > Name: Chart1

Then I open the report and the chart shows up as it should, with the legend -1, 0. This is because I didn't change the actual field to a Yes / No selection but kept the default -1/0.

What are you doing that is causing problems?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
The Following User Says Thank You to mmcdonal For This Useful Post:
kuznickic (January 13th, 2009)
  #4 (permalink)  
Old January 13th, 2009, 08:06 PM
Authorized User
Points: 216, Level: 4
Points: 216, Level: 4 Points: 216, Level: 4 Points: 216, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks mmc,

I'll give that a go. I think the problem rests more with my understanding of how pie charts work than Access. I know VBA but never really had to create any kind of charting capability before. Charts for whatever reason confuse me. I can create a query and view the chart in PivotChart view in the query but I just can't seem to make it work when I go to the report and try to create a chart in design view. The query I am using is this
Code:
SELECT Sum(Abs([Complete])) AS Completed, Sum(IIf([Complete],0,1)) AS NotComplete, Count("*") AS Total
FROM tblDiscrepancies;
. I think too that the chart designer in Access is not that intuitive.

Thanks,
Chris
Reply With Quote
  #5 (permalink)  
Old January 13th, 2009, 08:31 PM
Authorized User
Points: 216, Level: 4
Points: 216, Level: 4 Points: 216, Level: 4 Points: 216, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default

mmcdonal


THANK YOU, THANK YOU, THANK YOU!!!!

Works like a charm. I knew it couldn't be hard but for whatever reason that problem was kicking my okole.

Again many thanks.
Reply With Quote
  #6 (permalink)  
Old January 13th, 2009, 08:46 PM
Authorized User
Points: 216, Level: 4
Points: 216, Level: 4 Points: 216, Level: 4 Points: 216, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Okay just one quick question. How do I change the labels to say Complete and Not Complete.

Thanks
Chris
Reply With Quote
  #7 (permalink)  
Old January 14th, 2009, 02:48 AM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

What do the labels say now???

I would *HOPE* that the chart is smart enough to pick up the names from your SQL query. Which means you SHOULD be able do do
Code:
SELECT Sum(Abs([Complete])) AS [Complete ], 
       Count(*) - Sum(Abs([Complete])) AS [Not Complete], 
       Count(*) AS [Total]
FROM tblDiscrepancies;
(Hope you didn't mind my simplifying your query slighly.) I put a space into [Complete ] so that the name would be the same as the name of a field. Sometimes the query engine chokes if you use a field name for an alias. It shouldn't, but it does.
Reply With Quote
The Following User Says Thank You to Old Pedant For This Useful Post:
kuznickic (January 15th, 2009)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pie Chart jomet Pro JSP 2 March 10th, 2008 10:42 PM
Help on Pie Chart DudeBori82 Classic ASP Professional 9 May 3rd, 2005 04:24 PM
Pie-Chart crmpicco Javascript How-To 2 February 10th, 2005 06:34 AM
session.use_trans_sid is driving me crazy!! Snib Pro PHP 6 July 24th, 2004 04:51 AM
Pie Chart lryckman Access 0 April 26th, 2004 11:44 AM



All times are GMT -4. The time now is 05:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.