Do I need different reports to change Sort Order?

C

cp2599

I have a report that I want the user to be able to select the sort
order of the report. I thought I could do something similar to the
date selection on the Report Parameters Form, but the forms! parameter
in the query's ORDER BY clause does not work and it does not work on
the Report's Property ORDER BY field.

Can I change the sort order of a report, and if so, how. Or do I need
a separate report for each sort order?
 
D

Duane Hookom

This is the same question as you asked in the Queries NG. There are two/three
excellent replies there.
 
M

Marshall Barton

cp2599 said:
I have a report that I want the user to be able to select the sort
order of the report. I thought I could do something similar to the
date selection on the Report Parameters Form, but the forms! parameter
in the query's ORDER BY clause does not work and it does not work on
the Report's Property ORDER BY field.

Can I change the sort order of a report, and if so, how. Or do I need
a separate report for each sort order?


Report sorting should always be done in the report's Sorting
and Grouping window. The record source query's sorting and
the report's OrderBy property are only used after the stuff
in Sorting and Grouping making the, nearly useless and a
definte waste of time.

You can change the field used in a sort/group levelby using
code in the report's Open event procedure:

Me.GroupLevel(X).ControlSource=Forms!parameterform.sortfieldcombobox

Where X is the (zero based) item in the sort/group list.
 

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