Results 1 to 5 of 5
  1. #1
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162

    Looping through a multi select listbox - how do I do it?

    Hi,

    Ive been reading and reading but I dont really get how to do it. I have an sql query which outputs the results to a list box. What I then want to do is select some if not all of the listbox results and run an update query on them - I get what required its just the looping through the selections I dont understand. Does anyone have a working example or can they explain whats going on?

    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,143
    The link below as some code that loops through the selections
    http://allenbrowne.com/ser-50.html
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Thanks Bob, do you have to create a query to do this or can you do it all from VBA?

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,143
    Sorry, I'm not sure what you're asking.
    Can you do all what from VBA?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Quote Originally Posted by shabbaranks View Post
    Thanks Bob, do you have to create a query to do this or can you do it all from VBA?
    If you really want to, sure. But if all you want to do is read the data, then the easiest solution by far is to simply reference the original Query used to make the Listbox in the first place. It will have all the data in the Listbox and (presumably) you already know how to navigate through and search Recordsets. . .

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

Similar Threads

  1. Replies: 7
    Last Post: 11-24-2014, 02:11 PM
  2. Update Column from Multi-select listbox
    By jhargram in forum Forms
    Replies: 4
    Last Post: 02-27-2012, 12:03 PM
  3. Need Multi-Select listbox code example
    By Buakaw in forum Forms
    Replies: 4
    Last Post: 08-21-2011, 08:37 PM
  4. multi-select listbox and new entry button
    By user622 in forum Forms
    Replies: 2
    Last Post: 07-05-2011, 09:14 AM
  5. Multi-select listbox and update flag in table
    By Suresh in forum Programming
    Replies: 0
    Last Post: 12-19-2007, 01:04 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