Results 1 to 3 of 3

Thread: Listbox Question

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Question Listbox Question

    I have 2 listboxes with multiselect enabled.

    The first box is pre-populated, and the user selects what they want.

    They then click a button which copies the selection to listbox 2.

    When I use the code below, lstbranches1.text always holds the text for the last item they clicked before hitting the button !

    I'm probably being really dull, but this is annoying !

    Can anyone help ?

    Thanks.

    ++++++++++++++++++++++++++++++++++
    For i = 0 To lstBranches1.ListIndex
    If lstBranches1.Selected(i) Then
    lstBranches2.AddItem lstBranches1.Text
    End If
    Next i
    ++++++++++++++++++++++++++++++++++

  2. #2
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174
    VB Code:
    1. lstBranches2.AddItem lstBranches1.List(i)
    Computer /nm./: a device designed to speed and automate errors

  3. #3

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Smile Found it !

    I got it.

    I should have been using :

    lstBranches2.AddItem lstBranches1.List(i)

    Now it works fine.

    Thanks for the relpy though.

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