Do I need different reports to change Sort Order?

  • Thread starter Thread starter cp2599
  • Start date Start date
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?
 
This is the same question as you asked in the Queries NG. There are two/three
excellent replies there.
 
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.
 
Back
Top