Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get a report sorted

Status
Not open for further replies.

tsmits1975

Technical User
Mar 4, 2005
11
0
0
BE
Hi there.

I have an MS Access database which I converted from Access 97 to Access 2000. I now have problems with a report which has a query as recordsource. In the On Open event of the report (under Access '97) I set the orderby property with a string using the syntax "(queryname.queryfield) DESC" an the orderbyon property on true. However, I had to change this code to "(queryname![queryfield]) DESC" to get it running under Access 2000. This did not generate any error message so I assumed it worked, but when I took a closer look I saw that the sorting on the field queryfield did not take place anymore. The report now always sorts on this field ascending, no matter what I try. Does anyone know what is going on here? Any help will be greatly appreciated.
Thanks.
 
According to MichaelRed in the Access Queries and JET SQL:

unfortunatly, sorting a recordset for use in a report is usually a waste of time. ANY sorting / grouping in a report will reorder (sort) the source recorset to match the sorting grouping requirements, totally ignoring the original ordering. While the soloution provided by PHV is quite reasonable for the query, it will not help the report if you use any group header or footer. Alos, note that utilizing the group headers / footers in the report will provide the same result and the opportunity to provide a much more professional looking report.

Sounds like that's what's happenning here!

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top