Custom sort on a report

S

Secret Squirrel

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?
 
S

Secret Squirrel

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
 
S

Secret Squirrel

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
 
K

Ken Sheridan

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
 
S

shadreck vumisa

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?
 
Top