Custom sort on a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to create a select option for users to be able to sort a
report the way they want when they run the report? Some users may want it one
way and then others might want it sorted another. How can I give them this
option, if at all?
 
Hi Ken,
Actually I do have one question...Where do I point the combo box to choose
the fields for my sort function? Do I create another table with these field
names or maybe a value list? I'm a little confused there.

Thanks
SS
 
That sounds like it will do it! Thanks Ken!

Ken Sheridan said:
You can set the report's OrderBy and OrderByOn properties in its Open event
procedure. Say you are opening the report from a form with a combo box which
lists the fields from which a choice of sort order can be made then you'd use
something like this:

Me.OrderBy = Forms!YourForm!cboSortOptions
Me.OrderByOn = True

You can alternatively set one or more group levels if these are already set
up in the report, e.g.

Me.GroupLevel(0).ControlSource = Forms!YourForm!cboSortOptions

You can make the combo box on the form more user friendly by putting the
field names in a hidden first column and in a visible second column more
descriptive text expressions.

Ken Sheridan
Stafford, England
 
You can set the report's OrderBy and OrderByOn properties in its Open event
procedure. Say you are opening the report from a form with a combo box which
lists the fields from which a choice of sort order can be made then you'd use
something like this:

Me.OrderBy = Forms!YourForm!cboSortOptions
Me.OrderByOn = True

You can alternatively set one or more group levels if these are already set
up in the report, e.g.

Me.GroupLevel(0).ControlSource = Forms!YourForm!cboSortOptions

You can make the combo box on the form more user friendly by putting the
field names in a hidden first column and in a visible second column more
descriptive text expressions.

Ken Sheridan
Stafford, England
 
Secret Squirrel said:
Is there a way to create a select option for users to be able to sort a
report the way they want when they run the report? Some users may want it one
way and then others might want it sorted another. How can I give them this
option, if at all?
 

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

Back
Top