I am using the code below to filter a list of names that appear in a datagrid. As the user types in the letters of the last name, the program filters the recordset to those records that start with the letters typed in. The code works fast as long as there are records in the recordset. However, if the record set is empty because there are no names that match what the user typed in, then program responds very slowly. For example, if the user is looking for "Smithie" and there are people named "Smith" but not "Smithie", then the filter is lighting fast as the user types S-M-I-T-H. However, as I-E are typed the filter becomes very slow.
Does anyone have any ideas why this happens or of another way that might be faster?
Thanks in advance for any help.
Timoteo
Private Sub txtNameFilter_Change()
'Fliters the list in the MainGrid by last name according to userinput
If txtNameFilter = "" Then
rsSubMain.Filter = adFilterNone
Else
rsSubMain.Filter = "LName LIKE '" & txtNameFilter.Text & "*'"
End If
End Sub
Does anyone have any ideas why this happens or of another way that might be faster?
Thanks in advance for any help.
Timoteo
Private Sub txtNameFilter_Change()
'Fliters the list in the MainGrid by last name according to userinput
If txtNameFilter = "" Then
rsSubMain.Filter = adFilterNone
Else
rsSubMain.Filter = "LName LIKE '" & txtNameFilter.Text & "*'"
End If
End Sub