sorting of a2000 listbox contents

D

Dirk Goldgar

Silvester said:
Hi,

I have a 3 column A2000 listbox filled with values. I'd like to be
able to sort the contents ^v by clicking on the headings or buttons
and getting the rowsource to change.

I've been able to find code for listbox sorting but only for listbox
data from tables/queries.

http://www.rogersaccesslibrary.com/download3.asp?SampleName=ListBoxSorting.mdb

Does anyone know of how I can achieve this sort using perhaps, temp
multi-column arrays ?

You'd need code to parse the value list, which is a string, into a
two-dimensional array. You'd need a sort procedure to sort that array
into the desired sequence on the the selected column. There are plenty
of routines out there on the web for sorting arrays. After the array is
sorted, you'd reassemble it into a value list string and assign that
string to the list box's RowSource property.
 
D

Dirk Goldgar

Silvester said:
Thanks ! Ok, I got the parse function from
http://www.mvps.org/access/strings/str0003.htm

I am yet to find a decent sort function that works with Access...

Search the VB sites for an array sorting function that is designed for a
two-dimensional array. I have one for a one-dimensional array that
could be adapted pretty easily, but I don't want to take the time to do
that if you can find one ready-made. Or if you want to adapt it
yourself, I could post it for you.
 

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

Top