2 list box iteration

I

iccsi

I tried to process something for 2 list box and need to iterate 2 of
them and one iterates selected items one iterates all list

For i = 1 To lst1.ListCount
For Each VarItem In lst2.ItemsSelected
' my loop is here
Next VarItem
Next i

It seems that every VarItem increase the i increase as well.
I want VarItem to be inner loop which should be finish all seleted
item and go to next i.

Where is wrong to use above code?

Any information is great appreciated,
 
T

Tom van Stiphout

On Fri, 4 Jun 2010 07:49:08 -0700 (PDT), iccsi <[email protected]>
wrote:

No, this is indeed a nested loop and i is not incremented until we
loop over all items of the inner loop.
Set a breakpoint at the top of the code and step through it to see for
yourself.

-Tom.
Microsoft Access MVP
 

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