Sort records in the list box

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.
 
J

Jon

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
 
M

Malvina

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top