Good Morning Pro's,
I'm using recordset behind an unbound button click event. I am looking to sort a list in a listbox First, Ascending, THEN, without loosing focus I would like to sort Descending on the very next click. How would I achieve this? What I have thusfar.
Thanks,
I realize the code isn't correct. It's demonstrating what I'm trying to achieve.
I'm using recordset behind an unbound button click event. I am looking to sort a list in a listbox First, Ascending, THEN, without loosing focus I would like to sort Descending on the very next click. How would I achieve this? What I have thusfar.
Thanks,
I realize the code isn't correct. It's demonstrating what I'm trying to achieve.
Code:
Set db = CurrentDb
If (1st click) Then
mySql = " SELECT MyField From MyTable " _
& " ORDER BY MyField ASC "
Else (2nd click) Then
mySql = " SELECT MyField From MyTable " _
& " ORDER BY MyField DESC "
End If
Set rs = db.OpenRecordset(mySql, dbOpenSnapshot)
Comment