p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Access and Access VBA > Access
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2009, 09:51 AM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 13th, 2009, 03:52 AM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 42
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old January 13th, 2009, 08:27 AM
Friend of Wrox
Points: 9,476, Level: 41
Points: 9,476, Level: 41 Points: 9,476, Level: 41 Points: 9,476, Level: 41
Activity: 42%
Activity: 42% Activity: 42% Activity: 42%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,048
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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, 07:06 PM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old January 13th, 2009, 07:31 PM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 42
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old January 13th, 2009, 07:46 PM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2005
Location: Honoulu, HI, USA.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old January 14th, 2009, 01:48 AM
Friend of Wrox
Points: 4,259, Level: 27
Points: 4,259, Level: 27 Points: 4,259, Level: 27 Points: 4,259, Level: 27
Activity: 63%
Activity: 63% Activity: 63% Activity: 63%
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,197
Thanks: 3
Thanked 57 Times in 56 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 05: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 06:44 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc