Results 1 to 3 of 3
  1. #1
    MykeRuiz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2016
    Location
    Saudi Arabia
    Posts
    5

    Populating a listbox with another listbox

    Hello!



    May I ask how do I populate listbox B with listbox A? If the user selected an item in listbox A (double click) the item will be added to listbox B.

    Thank you!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    on dbl-click event, run a query using the listboxA in the criteria
    qaAdd1FromList = i nsert into table ( field ) values ( foms!myForm!lstBoxA)
    then refresh

    Code:
    sub lstboxA_dblclick()
    docmd.setwarnings false 
    docmd.openquery "qaAdd1FromList"
    me.listBoxB.requery
    docmd.setwarnings true
    end sub

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

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

Similar Threads

  1. Replies: 1
    Last Post: 01-31-2015, 09:03 PM
  2. Replies: 2
    Last Post: 03-23-2014, 06:50 AM
  3. Replies: 4
    Last Post: 06-24-2013, 07:34 AM
  4. Replies: 2
    Last Post: 02-04-2013, 10:49 PM
  5. Replies: 1
    Last Post: 09-10-2012, 11:21 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
  •  
Other Forums: Microsoft Office Forums