Results 1 to 4 of 4
  1. #1
    Korreia is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    5

    Question Need Help on - Remove Multiple selected Items from List box

    Hi All,



    I've search everywhere for an answer but could not find anything. I have 2 list box. I want to be able to move multiple item from list 1 to list 2 and remove the selected item from list 1 once moved.

    This is the code that I have currently. It work for a single item. However, if multiple item are selected, the code will only remove the last selected item and that's it. It seem like the .RemoveItem i triggers some sort of refresh on the list and it loose all selected items. If I comment out the .RemoveItem i, I can successfully add the selected item to list 2 but the items are not removed from list 1 ( of course)

    Code:
        Dim i As Integer
        Dim strItm
        
        With Me.lstMem
            For i = (.ListCount - 1) To 0 Step -1
                If .Selected(i) Then
                    lstMemPresent.AddItem (.Column(0, i))
                    .RemoveItem i
                End If
            Next
        End With
    Anyone has a clue or idea? I've try to look at some of the list property but to no avail....

    Thanks for any input/suggestion

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725

  3. #3
    Korreia is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    5

    Thumbs up

    Great! That solve my issue... Thanks for pointing it out

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Glad to help. Good luck with your project.

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

Similar Threads

  1. List Box Items Are De-Selected On A Screen Refresh
    By plengeb in forum Programming
    Replies: 2
    Last Post: 10-03-2012, 11:58 AM
  2. Replies: 18
    Last Post: 01-27-2012, 12:53 PM
  3. Replies: 2
    Last Post: 07-10-2011, 07:22 PM
  4. Replies: 6
    Last Post: 07-10-2011, 05:33 PM
  5. Replies: 5
    Last Post: 04-04-2011, 09:57 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