sort a list box from newest record to oldest

MK1999

New member
Local time
Today, 12:31
Joined
Mar 30, 2022
Messages
24
hello,
i have a list box including program name, year, code when the user click on the search bar the records pop up to the list box
i want to sort the records from the newest one to the oldest (descending order) is there any way to set descending order in the setting or a code that will sort the names by the largest id for example?
 
What is the rowsource of the listbox?
 
i want to sort the records from the newest one to the oldest (descending order) is there any way to set descending order in the setting or a code that will sort the names by the largest id for example?
apply an order by clause in the listbox rowsource

select somefields from aTable order by afield (desc)

edit: if you want a true order newest to oldest then ordering on the PK is based on when the record was created. The same would apply to a timestamp. If your table is a list of cars and their ages, the records almost certainly would not have been created in order of age if that is what you mean be 'newest to oldest' so you would need to order by age
 
Last edited:

Users who are viewing this thread

Back
Top Bottom