Unanswered: Query-based report not ordered properly
I have a query that joins two tables, one with names and the other with addresses, with the resulting recordset ordered by zip code. When I run the query by itself, the results are indeed ordered by zip code. But when I create a report based on the query (to print mailing labels), the results are not ordered by zip. Can anyone think of any possible reason why the order would be different for the query and the report based on it?
Thanks for the advice. I set the sort parameters in the report, and it worked fine. One more question: is there any way to set the sort parameters programmatically? Sometimes I want to sort by zip code, but other times I want to sort by name. Or do I have to have a separate report for that?
Try real hard not to use a separate report. Makes maintenance a pain in the neck. The best way to do it is by not using the sort and grouping
g of the report and use the vba of the report "OnOpen". Me. RecordSource = "qryXYZ"
Doesn't work with grouping, only with basic reports. Probably a way to do groupings programatically, but I've never needed to.