Hello people,
I have a listbox that gets populated when a command button on the same form is clicked. When, the listbox gets populated, a listbox in another form is also getting populated at the same time.
The problem is that when I try to remove an item from a listbox, I have an error. I cannot remove the item from the listbox in another form.
These are the two codes that I tried.
VB Code:
Dim Nm123 As String Nm123 = lstOrder.Text Dim ABC As Single ABC = -1 Dim Trial As String Dim DEF As String DEF = ABC + 1 For i = 1 To frmPizzaChoices.lstItems.ListCount Trial = frmPizzaChoices.lstItems.List(DEF) If Trial = lstOrder.Text Then frmPizzaChoices.lstItems.RemoveItem (DEF) End If Next i
This is a simpler code
VB Code:
frmPizzaChoices.lstItems.RemoveItem (lstOrder.ListIndex)
Can someone please suggest a different way to display this.




Reply With Quote