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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i want to make a report that sorts

Status
Not open for further replies.

kmayo503

MIS
Jun 21, 2003
70
US
i want to make a report that sorts by the name of the person and then by a check box. i have tried to sort by the name and it never works right. i have seperate tables for the name.
 
the names are from a sepporate table of names drawn in by a form with a combo box pointing to that table.

the structure is
tickets
Requester Text (List from table of names)
Date Reported Date/Time
Description of Problem Memo
Programs Opened Memo
Resolution Date Date/Time
Resolution Notes Memo
Done Number
Type Text
 
Hello

The "Requestor" field joins into another table with the full names into it.
My recommendation would be to create a query, displaying the full name and the field that is bound to the checkbox (normally a true/false one).
Then, set the "Sort" property on the name field to ascending.

If you run the query, you should see the data in name order.
The only time this won't work is if the first and last names are in the same field (eg "John Smith") and you want to sort it by surname then first name.

John
 
Keep in mind that sorting in a query has little or no effect on the report sorting which is handled with the Sorting and Grouping dialog in the report.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
dhookom

That in itself is true, but the default of no groups or sorting will give the data in the exact order it comes from the query or underlying SQL statement. Moreover, for those who don't understand how they work with each other, it can be all to easy to get contradicting sorts, which slows down the report opening and data retrieval time.

John
 
I believe my results have varied on this in the past (not sure of the versions) when a criteria or where clause was applied to the OpenReport method. That is why I always recommend using the most reliable method of sorting a report which is by using the report's sorting and grouping dialog. Any sorting set up in the report using this method will over-ride the order of the records in the query.

I have not noticed any increase in performance when opening a report based on a sorted query but there might be some.

Getting back to the initial question, I think the table is suffering from the use of a lookup field defined in a table. I always recommend not using this "feature" since it causes confusion.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
The sort order of the underlying query does have an effect on the output of the data, provided you have not set an overriding condition in the report itself. For instance, take a report with grouping levels consisting of:

Parent Company
____Company
________Employees

Sorting by Parent Company would be redundant in this scenario, as you have already explicitly defined a the first grouping level as Parent Company. However, if you were to send a dataset sorted by either Company or Employees, the effect would be to sort each sub-set within the grouping levels. So the employees for Company A would be in alphabetical order, then Company B and all their employees in alphabetical order etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top