Results 1 to 9 of 9
  1. #1
    duece7 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    8

    Change Report Chart X Axis Order

    Hi everyone,

    I have a chart like the one below where I want to change the sort order of the bottom data to be custom so I can make it 1, 2, 3, and not 1, 10, etc.

    Any ideas?


    Click image for larger version. 

Name:	Capture.PNG 
Views:	9 
Size:	11.5 KB 
ID:	23013

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Options:

    1. convert the values to number type, either change the field type or use a function to CAST the data to a number type - Val(fieldname)

    2. format the values to have leading filler zeros, like: 01, 05, 10 - Format(fieldname, "00")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    duece7 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    8
    Thanks for the advice, only problem is there is text in this field as well. Some of the charts it populates has text that was counted as well as numbers. Any other ideas?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Try option 2 anyway. If the value is non-numeric, like "ABC", it should be unaffected by the Format() function.

    Use however many zeros are needed for the largest number value to be encountered. Digits will always sort before alphas.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    duece7 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    8
    Nothing happened.

    Here's my row source data/query for the charts.


    Click image for larger version. 

Name:	Capture4.PNG 
Views:	9 
Size:	4.8 KB 
ID:	23019

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    The CInt() calculated field does not have CROSSTAB parameter. What is it for? Should remove it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    duece7 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    8
    Yeah I think I put it in there a while back to help sort something else that wasn't sorting properly. I took it out and it doesn't look like it messed anything up but the numbers on the chart still go 1, 10, etc..

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Are the leading zeros in the query datasheet view?

    The function works for me in a normal SELECT query. AFAIK, should work in the CROSSTAB.

    If you want to provide db for analysis, follow instruction at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    duece7 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2015
    Posts
    8
    For some reason I couldn't get it to work with just formatting but doing the following worked. Thanks for your help and getting my noodle going to put this together.

    =iif(len(fieldname)<=2,right("00" & fieldname,2),fieldname)

    That resorted the chart headers and kept the long text headers when they weren't numbers

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

Similar Threads

  1. Chart Y Axis Whole Integers
    By james28 in forum Reports
    Replies: 3
    Last Post: 08-21-2014, 12:31 PM
  2. Formatting Chart Axis
    By kab16 in forum Access
    Replies: 2
    Last Post: 06-05-2014, 11:13 AM
  3. Scaling a Chart Axis
    By Paul H in forum Reports
    Replies: 5
    Last Post: 10-16-2013, 01:50 PM
  4. Replies: 5
    Last Post: 01-15-2013, 01:15 PM
  5. Chart axis change with .Chartype changes
    By alangea in forum Programming
    Replies: 2
    Last Post: 05-20-2012, 12:41 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