Results 1 to 9 of 9
  1. #1
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43

    Piechart legend zero truncation


    My legend in the piechart has values like 004,008 etc but while the report is created,the legend has the preceding 0's truncated and 004 is shown as 4 and 008 is shown as 8. Is there a way to fix that and avoid removal of preceding zeros in the legend. Thanks for the help !

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    Can you show us some of the code involved?

    You might be able to use Format(yourField,"000")

  3. #3
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43
    I am not using any code. I am just using a simple query to create a graph in a report. This report is triggered by a button click

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    Please show the sql of the query? You can probably include the format statement to keep your leading zero.

  5. #5
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43
    This is my query:
    SELECT Table1.[Abend Type], Count(*) AS Expr1
    FROM Table1
    WHERE (((Table1.[App Name])="App1") AND ((Year([ArrivalTime]))=Year(Date())-1) AND ((Month([ArrivalTime]))>=Month(Date())-1)) OR (((Table1.[App Name])="App1") AND ((Year([ArrivalTime]))=Year(Date())) AND ((Month([ArrivalTime]))<Month(Date())))
    GROUP BY Table1.[Abend Type]
    HAVING (((Count(Table1.Case))>5));


    The query results show Abend Type correctly along with preceding zeros.
    However when the graph is generated then the legend removes these preceding zeros. I dont find an option to force the legend type to text to avoid removal of leading zeros. Thanks for the help

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    Try this and see if it makes a difference:

    SELECT Format(Table1.[Abend Type],"000") as AbendType, Count(*) AS Expr1
    FROM Table1
    WHERE (((Table1.[App Name])="App1") AND ((Year([ArrivalTime]))=Year(Date())-1) AND ((Month([ArrivalTime]))>=Month(Date())-1)) OR (((Table1.[App Name])="App1") AND ((Year([ArrivalTime]))=Year(Date())) AND ((Month([ArrivalTime]))<Month(Date())))
    GROUP BY format(Table1.[Abend Type],"000")
    HAVING (((Count(Table1.Case))>5));

  7. #7
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43
    Thanks,as I emntioned earlier, the abend type result from the query shows leading zeros even without the format statement because it is defined as atext field in the table. The problem happens only at the point where the legend is created in the chart. Still the chart legend shows 0004 as 4 only. I would like to know if there is a way to force the legend to a text type.Thanks again!

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    Don't know if this is helpful, but I don't use charts often enough to know how to adjust the properties of legend etc.

    This may help or lead to more info
    http://www.yevol.com/en/access2003/Lesson20.htm
    http://forums.whirlpool.net.au/archive/546676
    http://www.vb123.com/toolshed/99_graphs/msgraph1.htm
    http://www.vb123.com/toolshed/99_vbchart/vbchart1.htm <<shows how to reference the legend

  9. #9
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43
    I have no clue if there is an option to change the format of the legend to text .So I reformatted my data and prefixed my data with a colon and by that it forces the data as text and 0004 is written successfully as :0004 into the legend. There may be other solutions but this works...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Chart legend appears as date
    By Vronsky in forum Programming
    Replies: 0
    Last Post: 06-09-2011, 05:20 AM
  2. Fieldset and Legend feature in Access?
    By ibmichael in forum Forms
    Replies: 1
    Last Post: 10-28-2010, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums