Results 1 to 20 of 25

Thread: Populate ComboBox with contents of ListBox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Okay, so I realized today that the code I worked out doesn't work for what I need to do. I need to be able to copy the selected item from Box 1 to Box 2. I want the user to be able to select multiple items at one time. Right now, if I try to call the .Value property of the listbox while it's MultiSelect property is set to fmMultiSelectMulti, it returns errors. It only works if I set it to single.

    Here's what I have right now:

        Dim i As Variant
        If TListBox2.ListIndex = -1 Then Exit Sub
        For i = 0 To List2.ListCount - 1
        If TListBox2.Value = List2.List(i) Then
            Beep
            Exit Sub
        End If
        Next i
        List2.AddItem TListBox2.Value
    I tried to replace "value" with Selected(0) but it doesn't seem to work... Any ideas?
    Last edited by Aussiebear; 12-20-2024 at 05:03 PM.

Posting Permissions

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