removing items from a list box based on the individual items content
hello
i am trying to remove items from a list box based on if they contain the text acknowledged or not.
If i acknowledge 1 item , it appends the word acknowledge to the end of the currently selected item in the listbox, then if i click my clear button the item in the list box will go using removeat key word. however, if i click the button acknowledge all then this adds the string acknowledge to the end of all items in the list box
my problem is if i then select the clear button only half the items will be gone even thoguh all items show has having the word acknowledge appended to them in the list box.
its an alarm list. here is the code, i think its close. many thanks in advance
Dim
AcknowledgedAsStringDim iAsIntegerTryIf ListBox1.SelectedIndex >= -1ThenFor i = 0To ListBox1.Items.CountListBox1.SelectedItem = i
ListBox1.SelectedItem.Equals(i)
Acknowledged = ListBox1.GetItemText(ListBox1.SelectedItem)
If AcknowledgedLike"*Acknowledged*"ThenListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
ElseBeep()
EndIfNext iEndIfCatchMsgBox(
"error with sub procedure")EndTry.
