provide sorting criteria

  • Thread starter Thread starter sps
  • Start date Start date
S

sps

I have a form that is used to create SQL statements which
are then used to update a subform. There are 5 items
which I would like to give the user the ability to sort
on. I currently have check boxes for these 5 items to
allow them to select what they want to sort by. The
problem with this is the order of the sorts cannot be
changed. I would like to provide the ability to choose
multiple sort fields, determine the order that they will
sort in, and select ascending/descending for each field.
Any ideas on how this can be done?
 
Rather than showing the item names, you could provide five
combo boxes, each getting their Rows from the list of five
items, with an Option Group for ASC or DESC, and letting
them fill them out in order.

You could then build a sort string by looping through the
five combo boxes, checking if they contain a value, and
seeing whether ASC or DESC is checked, and using the value
with the Sort property of a recordset.

See VBA Help on the Sort property.

HTH
Kevin Sprinkel
 
Back
Top