Link to home
Start Free TrialLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

How can i loop thru a Listbox and remove one item at a time..

I am using a code like below to retrive one item at a time but it causes me problems

For i = 0 To Me.lstListBox2.Items.Count - 1
                    MsgBox(Me.lstListBox2.Items.Item(i))
                    Me.lstListBox2.Items.Remove(Me.lstListBox2.Items.Item(i))
Next i

i want the code to diplay a msgbox for the each item in the list and then remove it. Ultimatley
i will not display a message box but rather stick some dtabase code ther but for debug it will do.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial