How to set the sort order of a report from a query

L

LMid

Hi, I have one report which I want to display with a few differan
sort orders. I want the user to be able to choose in what order th
report should be displayed, but I don't want to create a differan
report for each order. From what I've seen an Access report ignore
any sort order given by a query. Is there a way around this

My query
select * from customer order by lastName, firstNam
or for example
select * from from customer order by zip, lastName, firstNam

Right now I am doing this in the report_open method by settin
me.recordsource equal to my sql

Any help would be appreciated
 
G

Guest

In design view of your report, you can select sorting and grouping from the
view menu, then select the field and sort order that you need, you can setup
this property using VBA as well by setting up properties me.orderby and
me.orderbyon, consult the help file for more details,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top