Click to See Complete Forum and Search --> : List box


jcardo
September 12th, 2001, 08:01 PM
In my aplication I'm using Microsoft ActiveX Data Object Libraray. I have populate with code a List Box (the user can select more than one item (MultiSelect 1- simple).How can I filter a Recordset with the multiple selection?
Here the code that I use to populate the list box
Private Sub Form_load()
With mrsPartCode
Do Until .EOF
LstPartCode.AddItem !PartCode & vbTab & !PartDesc
.MoveNext
Loop
.MoveFirst
End With
End Sub

srinika
September 12th, 2001, 09:54 PM
I can give u a hint on how to break the problem in to small pieces.
I assume that u have a button to click after u select Parts from ur list.
1. Find a way to get the "selected items of a list box"
2. Find a way to construct a SQL statement with the selected list with "OR" in between each list item.
Eg. Select * from tblParts where itemCode=IC1 OR itemCode=IC2 OR ....

3. SQL statement construction method has to be called either in the above 1. or once after an array is filled after completing 1.
Hope this put u in the track
Srinika