CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: List box

  1. #1
    Join Date
    Sep 2001
    Posts
    2

    List box

    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



  2. #2
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: List box

    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


    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured