Results 1 to 9 of 9
  1. #1
    NCSue0514 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2017
    Posts
    3

    Cannot get field to sort alphabetically.

    I've built a report based on a query in which the "Company" data is sorted alphabetically. The query sorts A -> Z. The report will NOT sort alphabetically, even using the sort/group option. I'd appreciate any suggestions.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Reports have their own Sorting and Grouping.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    is the field in question a lookup field? If so that will be the reason - it is sorting on the ID, not the name. It is one of the well known problems with using lookup fields.

  4. #4
    NCSue0514 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2017
    Posts
    3
    OK. You have to start on the assumption that I'm a bit of an idiot. It's been 10+ years since I "learned" rudimentary access, the program has changed, and my memory is failing.
    I built a query which draws the info from a table. I based the report on that query (source = tblCAC).
    The query sorts alphabetically. I clicked the group/sort thingy in Access and reiterated to the program that I want alphabetical sort based on field "Company". It won't.

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I suggest you post a copy of the database.
    2 typical issues are---
    - not using report sort/group
    - and using lookup fields in tables

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    As others said, you do not need to do sorting in the query, just in the Sorting and Grouping in the report. Can you give us some example values that are in the Company field. We assume they are just text. When you run the report, can you tell what field is is sorting by if not the Company field?

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    ORDER BY in query will be overridden and ignored if the report has any Sorting & Grouping setup.

    And it does sound like the 'Company' field has a Lookup set in table (I never set Lookup in table) and is really sorting on ID - even though you see a company name, the actual value is the ID. The report design probably defaulted to a combobox, change it to a textbox and you should see the ID. Include the lookup table in the query so related data is available and apply sort to the field from the lookup table.
    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.

  8. #8
    NCSue0514 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2017
    Posts
    3
    So I cleared the alphabetical sort in the query and the problem was resolved in the report.
    Is this a bug or a feature?

    Thanks for the help!

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I just did a test and need to correct earlier statement. ORDER BY in query is always ignored by report. It is the OrderBy property that will be ignored if Sorting is set up but not if only Grouping. Feature.
    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.

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

Similar Threads

  1. Continuous Form Ordering Alphabetically
    By Paul H in forum Forms
    Replies: 3
    Last Post: 09-20-2016, 02:39 PM
  2. Replies: 4
    Last Post: 02-14-2015, 05:56 AM
  3. Replies: 1
    Last Post: 11-16-2014, 04:28 PM
  4. Replies: 3
    Last Post: 12-02-2011, 07:59 PM
  5. Search Persons (alphabetically)
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 07:31 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