Sorting records on a form

Courtman

Paranoid Android
Local time
Today, 15:10
Joined
Dec 8, 2001
Messages
34
I have a form which contains a sub-form with the results of a query. I would like to add an option box which allows the user to re-sort the query by different columns.

The options would be:

SORT BY:
  • Airfield Name (default)
  • Date of First Visit
  • No. of Visits
...and this would re-sort the sub-form.

Can anyone help with this?
 
I put this code on the double click event on the relevent fields in the subform

DoCmd.RunCommand acCmdSortAscending

Can then order by - say - date, job no, client etc

HTH
Dave
 
So if I were to run this code using radio buttons, could I do the same with an "OnClick" event? And how does that command know which field to sort by?

Thanks for the reply, I'm a bit slow on some of this stuff!!!
 
After a bit of fiddling I couln't get the sort to work form the radio buttons. I made a quick select case that set the focus back to the field in the subform but got the error 'the command sortascending isnt vailable right now.'

As I refered to in my other post, I should have added that I put a label just above the subform saying 'double click in a field to sort A-Z'

Dave
 

Users who are viewing this thread

Back
Top Bottom