How can I search a collection full of objects to find 1 or more objects with a certain property that matches what was given? So far I have this code already written but the red line doesn't work
motorID is the property I'm looking at and intCounter is the index of the items added to the collectionVB Code:
Friend Function Find(ByVal strMotorID As String) Dim intCounter, intCollectionSize As Integer intCollectionSize = Me.Count Do While intCounter <= intCollectionSize [COLOR=Red]If Me.List.Item(intCounter).MotorID = strMotorID Then[/COLOR] intCounter += 1 End If Loop





Reply With Quote