Is there a property that will automatically order the items in my list box in Ascending order?
Is there a property that will automatically order the items in my list box in Ascending order?
the query does the order.
If you dont like the alphabetical order, add a 2nd column that is numeric and sort by that.
It’s not doing it in my case.
i have a table that gets populated.
each time data is added to the table using insert into statement whilst preserving the existing data, it is not ordered despite putting an order by clause in the sql statement.
consequently, my list box that gets its data from this table is unordered too which makes it hard for the user to select items from the list box.
Please show us a copy of the database or the vba code that interacts with the list box.
For the listbox rowsource you could use something along these lines generally:
Ascending is the default Ordering.Code:Select yourfld, yourfld2 from yourTable Order By yourfld2
For all intents and purposes, there is no such thing as a table order - at least when dealing with queries or recordsets. You seem to be saying that you expect the append query to perform some kind of sort. It will not. The query you need to impose a sort in is the query that populates the listbox, not the table.each time data is added to the table using insert into statement whilst preserving the existing data, it is not ordered despite putting an order by clause in the sql statement.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Thanks orange, this is working now after your helpful input.
Good stuff -- happy to help.