Report sorting

S

Scott Sisk

I have a report that has 10 columns. I would like to give
the user a drop down box that will allow them to chose
which column the report will sort on. Is there a way to
do this?
 
M

Marshall Barton

Scott said:
I have a report that has 10 columns. I would like to give
the user a drop down box that will allow them to chose
which column the report will sort on. Is there a way to
do this?


I presume that you have a form with the field list combo box
and a button to open the report.

Given that, add an item in the report's Sorting and Grouping
to sort the report on any one of the fields in the report's
record source table/query. Then add a line of code to the
report's Open event procedure:

Me.GroupLevel(0).ControlSource = Forms!theform.thecombobox

If you have some other group levels, change the 0 to the
level of the sorting used for this purpose.
 

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