Sort records in the list box

  • Thread starter Thread starter Malvina
  • Start date Start date
M

Malvina

Hello all,
I am trying to set up a code where my user will be able
to sort records in the list box. so far I used my
recordset query that generates the list box and sort it by
the item in the second column:
'****************************
Set rst = db.OpenRecordset("SELECT MAIN_ID, CLIENT_NAME,
MCT_VALUE_TXT, CLNT_ID " _
& " FROM rqryChoose WHERE MAIN_ID " &
lstChoosenList.Column(0, 1) & "" _
& " and MCT_VALUE_TXT = '" & lstChoosenList.Column
(2, 3) & "'" _
& " ORDER BY '" & lstChoosenList.Column(2, 3)
& "'")
rst.MoveFirst
'*****************************

nothing happens
Please give me any suggestions.

thank you ,
Malvina S.
 
Malvina said:
Hello all,
I am trying to set up a code where my user will be able
to sort records in the list box. so far I used my
recordset query that generates the list box and sort it by
the item in the second column:
'****************************
Set rst = db.OpenRecordset("SELECT MAIN_ID, CLIENT_NAME,
MCT_VALUE_TXT, CLNT_ID " _
& " FROM rqryChoose WHERE MAIN_ID " &
lstChoosenList.Column(0, 1) & "" _
& " and MCT_VALUE_TXT = '" & lstChoosenList.Column
(2, 3) & "'" _
& " ORDER BY '" & lstChoosenList.Column(2, 3)
& "'")
rst.MoveFirst
'*****************************

nothing happens
Please give me any suggestions.

thank you ,
Malvina S.


Malvina

See if this page on my site helps -
http://www.applecore99.com/frm/frm037.asp, where I explain one way of
sorting a list box when the user clicks on toggle buttons placed
above/below the columns. There is also a small database that you can
download that has the code in.

Jon

Access tips & tricks - http://www.applecore99.com
Microsoft Access webring -
http://a.webring.com/hub?ring=microsoftaccess
 
Jon, you are the best!!!!!!!

Thanks you so much.
-----Original Message-----
"Malvina" <[email protected]> wrote in


Malvina

See if this page on my site helps -
http://www.applecore99.com/frm/frm037.asp, where I explain one way of
sorting a list box when the user clicks on toggle buttons placed
above/below the columns. There is also a small database that you can
download that has the code in.

Jon

Access tips & tricks - http://www.applecore99.com
Microsoft Access webring -
http://a.webring.com/hub?ring=microsoftaccess
.
 
Back
Top