Dynamically Sorting

Becca

Registered User.
Local time
Today, 13:07
Joined
Dec 12, 2001
Messages
58
Hi

I have a form with a multi - column list box on it. What I would like is to be able to click on one of the column headers and be able to dynamically sort the data in the list box. I have seen this done in other programs for reports - but I get the feeling a list box doesn't have this capability.

Anyone have any ideas if there is a way of doing this?

Thanks
 
I haven't really considered doing a dynamic sort of a list box to date, so someone may have a much more nifty idea than me. (You may find something searching the archives.)

What I would try:

Instead of having the Column Headings in the list box, put Command Buttons above your list box over each column and label them with your Column names. If your list box is built on a query, you would just re-define your query according to the sort order of the chosen column, set your RecordSource for the list box to the new querydef (in that button's On_Click event) and then Requery your list box.

Seems relatively straightforward, and I don't doubt that Access is capable of this.

HTH,
John
 
Will try that - thanks for your help.
 
While on other business . . .

I happened to find a sample db that sorts a listbox by clicking on the column headers at this site (check under 'L' for listbox) ;)
 

Users who are viewing this thread

Back
Top Bottom