Results 1 to 8 of 8
  1. #1
    gemxsec is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4

    (Help)How To Transfer MultipleSelect Item In Listbox to another Listbox ?

    Excuse me
    I want to ask How To Transfer MultipleSelect Item In Listbox to another Listbox ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Do you want the 'transfer' to occur immediately when selected? Use Click event of the multi-select listbox with AddItem method to add rows to the second listbox.

    Why do you want to do this?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gemxsec is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4
    I want to try transfer item in the listbox to another listbox.
    I succeed to transfer selected item, but I can't transfer multipleselect item.
    Help me please.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    You have to loop through the listbox selected items.
    Review
    http://allenbrowne.com/ser-50.html
    http://office.microsoft.com/en-us/ou...080805489.aspx.
    Your adaptation would be something like:
    Code:
      
        With Me.lstBox1
            For Each varItem In .ItemsSelected
                If Not IsNull(varItem) Then
                    Me.lstBox2.AddItem(varItem) 'I am not sure about this syntax
                End If
            Next
        End With
    This thread http://www.vb6.us/tutorials/indepth-...stbox-tutorial has a lot of info about working with listboxes. Your issue is discussed about quarter of the way down.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    gemxsec is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4
    Quote Originally Posted by June7 View Post
    You have to loop through the listbox selected items.
    Review
    http://allenbrowne.com/ser-50.html
    http://office.microsoft.com/en-us/ou...080805489.aspx.
    Your adaptation would be something like:
    Code:
      
        With Me.lstBox1
            For Each varItem In .ItemsSelected
                If Not IsNull(varItem) Then
                    Me.lstBox2.AddItem(varItem) 'I am not sure about this syntax
                End If
            Next
        End With
    This thread http://www.vb6.us/tutorials/indepth-...stbox-tutorial has a lot of info about working with listboxes. Your issue is discussed about quarter of the way down.
    sorry, Can u explain this script

    Code:
    Private Sub cmdMoveToLeft_Click()
    Dim i As Integer
    If List2.ListIndex = -1 Then Exit Sub
    For i = List2.ListCount - 1 To 0 Step -1
    If List2.Selected(i) = True Then
    List1.AddItem List2.List(i)
    List2.RemoveItem i
    End If
    Next i
    End Sub
    
    Why that's script not work, when I try it.

    http://www.vbexplorer.com/VBExplorer...0/june2000.asp

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Don't know, what happens - error message, wrong results, nothing? Where did you put the code?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    gemxsec is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    4

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    I don't understand. The error is 'error'? Need more info.

    I have never set up listboxes like this.

    Can provide the file for analysis. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. pick listbox item to open specific record
    By accesshelpme in forum Access
    Replies: 1
    Last Post: 05-20-2012, 01:08 AM
  2. Replies: 1
    Last Post: 12-18-2011, 01:09 AM
  3. Listbox
    By mikejames in forum Forms
    Replies: 1
    Last Post: 10-25-2011, 07:53 AM
  4. listbox help
    By imintrouble in forum Access
    Replies: 2
    Last Post: 10-20-2011, 01:53 PM
  5. Listbox Help
    By allykid in forum Programming
    Replies: 2
    Last Post: 03-30-2011, 06:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums