I have search the threads and came accross thread: Update ListBox from CheckBox
But that did not help me.
Here is my problem: I am trying to unload a combo box. I have five items in my combo box. When it get to item number three it throws error 6013: Unable to remove item. '3' not found in list. If I end and run the code again it works until it gets to the last indexed item and then if I hit end it runs again and it works.
I would like to unload all of the items. I don't know what I am doing wrong..
Here is my code:
Private Sub cmdReDo_Click()
Dim x As Integer
Dim y As Integer
'Empties the combo list of all of the file names.
y = Me.cboFileList.ListCount - 1
For x = 0 To y
Me.cboFileList.RemoveItem (x)
Next
It is almost as if the listcount looses it's place.
Thanks in advance for any help.
But that did not help me.
Here is my problem: I am trying to unload a combo box. I have five items in my combo box. When it get to item number three it throws error 6013: Unable to remove item. '3' not found in list. If I end and run the code again it works until it gets to the last indexed item and then if I hit end it runs again and it works.
I would like to unload all of the items. I don't know what I am doing wrong..
Here is my code:
Private Sub cmdReDo_Click()
Dim x As Integer
Dim y As Integer
'Empties the combo list of all of the file names.
y = Me.cboFileList.ListCount - 1
For x = 0 To y
Me.cboFileList.RemoveItem (x)
Next
It is almost as if the listcount looses it's place.

Thanks in advance for any help.