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.
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.
Reports have their own Sorting and Grouping.
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.
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.
I suggest you post a copy of the database.
2 typical issues are---
- not using report sort/group
- and using lookup fields in tables
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?
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.
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!
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.