I have this code below in the textbox Change event. It is part of an Auto-Complete code.
It all works ok, except when I try to change the textbox string to all three columns of the listview. This makes the Change event fire again and I get the error:

Object variable or With block variable not set

on this line:

vb Code:
  1. lvwMembers.FindItem(txtSearch.Text, , , lvwPartial).Selected = True

My complete code is:
vb Code:
  1. Private Sub txtSearch_Change()
  2. On Error GoTo ErrTrap
  3.  
  4. Dim LvwItm As ListItem
  5. Dim Strt As Integer
  6.  
  7. 'If firing in response to a backspace or delete, don't run the auto-complete
  8. 'complete code. (Otherwise you wouldn't be able to back up.)
  9.  
  10. If blnBackSpace = True Or txtSearch.Text = vbNullString Then
  11.      blnBackSpace = False
  12.      Exit Sub
  13. End If
  14.  
  15. 'Run through the available items and grab the first matching one.
  16. If lvwMembers.ListItems(lvwMembers.SelectedItem.index).EnsureVisible = True Then
  17.     'search the first column (First Name)
  18.     lvwMembers.FindItem(txtSearch.Text, , , lvwPartial).Selected = True
  19. End If
  20.  
  21. 'If something was chosen then we get the rest of it
  22. Strt = Len(txtSearch.Text)
  23. 'add full name to txtSearch
  24. If Len(lvwMembers.SelectedItem.SubItems(1)) = 0 Then
  25.     txtSearch.Text = lvwMembers.SelectedItem.Text & " " & lvwMembers.SelectedItem.SubItems(2)
  26. Else
  27.     txtSearch.Text = lvwMembers.SelectedItem.Text & " " & lvwMembers.SelectedItem.SubItems(1) _
  28.                                                  & " " & lvwMembers.SelectedItem.SubItems(2)
  29. End If
  30. txtSearch.SelStart = Strt
  31. txtSearch.SelLength = Len(txtSearch.Text) - Strt
  32.  
  33. Exit Sub