Daniel said:
Dirk,
In this case my row source is not a query or table so I cannot use
the query builders with the sort option. My listbox is populated on
the fly through coding?!
Is there a solution? I saw someone mention populating a table with
the values and then using it as a row source but I don't like that
idea too much?!!!
So your listbox's RowSource is a value list? Or are you using a custom
RowSourceType function? I'm guessing it's the former.
Unless you want to recreate the value list every time the sort order
changes -- with whatever underlying sort mechanism you might use -- I
think you would do much better to use a query as your rowsource. That
way you can sort the values any way you want, just by changing the ORDER
BY clause of the query. Ideally, you would not use a table that is
dedicated to be the rowsource for this list box, but rather would query
some existing table or tables for the list items.
Where do the values for this list box come from, anyway? You're working
in a database, so it makes sense that most data would ultimately be
stored in tables, from which you can extract what you want by way of
queries. You haven't told us any details about why you are calculating
the list items on the fly, so I don't know if that broad generalization
is out of line, but it sure seems you're doing something unusual.