Automatically selectings items in a list box using a list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a button that when the user selects an item from the list
box and then clicks the button, an update query runs to update the selected
item from the list box. I'm trying to write some code that will allow the
user to click a button that using a loop will automatically select each item
in the list one at a time and then run the update query for each item. The
problem I'm having is writing the code that automatically selects the next
item in the list box.

For example, right now I have:

dim listCounter as integer

for listCounter=0 to listbox.listcount()-1
listbox.listindex=listCounter
next

I tried listIndex but it doesn't seem to work. Any help appreciated. Thanks.
 
Take a look at the ItemsSelected collection in the help files. I can't
provide a sample at the moment, but I'm pretty sure that's what you
would need to use in a multi-select listbox.
 
Back
Top