A
Ayo
I get the above error in my code on line Me.ListBox2.Remove Item i. What I am
attempting to do is remove any item from the ListBox2 in excess of 25 Item.
In other words, if the user attempts to place 26 or more items in the ListBox
a message is display and the excess items are removed.
This is my dilemma. Any help will be greatly appreciated.
For i = 0 To ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True And i <= 25 Then
Me.ListBox2.AddItem ListBox1.List(i)
ElseIf ListBox1.Selected(i) = True And i > 25 Then
MsgBox Msg, Style, Title
Me.ListBox2.RemoveItem i
Exit For
End If
Next i
attempting to do is remove any item from the ListBox2 in excess of 25 Item.
In other words, if the user attempts to place 26 or more items in the ListBox
a message is display and the excess items are removed.
This is my dilemma. Any help will be greatly appreciated.
For i = 0 To ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True And i <= 25 Then
Me.ListBox2.AddItem ListBox1.List(i)
ElseIf ListBox1.Selected(i) = True And i > 25 Then
MsgBox Msg, Style, Title
Me.ListBox2.RemoveItem i
Exit For
End If
Next i