Automatically selectings items in a list box using a list

P

pareez

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.
 
S

storrboy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top