Here's my code:
VB Code:
  1. Dim SearchString As String
  2. Dim oItem As ListItem
  3. Dim oSubItem As ListSubItem
  4.                          
  5. SearchString = InputBox("", "Search", "Enter Customer Name", 5800, 5240)
  6.  
  7. For Each oItem In ListView1.ListItems
  8.     If InStr(1, oItem.Text, SearchString, vbTextCompare) Then
  9.         oItem.Selected = True
  10.         oItem.EnsureVisible
  11.         ListView1.SetFocus
  12.         Exit For
  13.     Else
  14.         For Each oSubItem In oItem.ListSubItems
  15.             If InStr(1, oSubItem.Text, SearchString, vbTextCompare) Then
  16.                 oItem.Selected = True
  17.                 oItem.EnsureVisible
  18.                 ListView1.SetFocus
  19.                 Exit For
  20.             End If
  21.         Next
  22.         If Not oSubItem Is Nothing Then Exit For
  23.     End If
  24. Next


I need to loop a peice of code until it can no longer find the "SearchString".

How would I go about doing that?