Results 1 to 4 of 4
  1. #1
    WDC is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    6

    Getting Compile error: Method or data member not found

    When attempting to move multiple selected items from one multi-column list box to another with the code below, I get the Compile error: Method or data member not found. It appears to fail on the line that reads Me.ListBox2.AddItem Me.ListBox1.List(i). Thanks in advance for help on this one.

    Private Sub CmdMoveItems_Click()



    Dim i As Long

    For i = 0 To Me.ListBox1.ListCount - 1
    If Me.ListBox1.Selected(i) = True Then
    Me.ListBox2.AddItem Me.ListBox1.List(i)
    End If
    Next i

    For i = Me.ListBox1.ListCount - 1 To 0 Step -1
    If Me.ListBox1.Selected(i) = True Then
    Me.ListBox1.RemoveItem i
    End If
    Next i

    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    Me.ListBox1.ItemData(i)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    WDC is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    6
    Thanks pbaldy, that worked!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Compile Error: Method or data member not found
    By JustinC in forum Programming
    Replies: 4
    Last Post: 11-18-2014, 10:25 AM
  2. Replies: 3
    Last Post: 06-27-2014, 01:09 AM
  3. compile error method or data member not found???
    By chuman vishal in forum Programming
    Replies: 2
    Last Post: 02-26-2013, 01:57 PM
  4. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  5. Compile Error: Method or data member not found
    By subtilty in forum Programming
    Replies: 5
    Last Post: 02-09-2012, 07:56 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