My search command is looking for a Part by it's description. The following code works great for an exact match search but I would like a code that will go to the closest match in the recordset. Any help will be appreciated....

Private Sub search_cmd_Click()
Dim txtsid As String
Dim Founder As Boolean

txtpart = UCase(InputBox("Enter Part Description:", "Description Search"))
If Len(txtpart) > 0 Then
Founder = False
End If

Do While (Not Founder) And (Not Data1.Recordset.EOF)

If UCase(Data1.Recordset.Fields("Description").Value) = txtpart Then
Founder = True
Exit Sub
End If

If Not Founder Then
MsgBox "Unable to find the required item", , "Not Found"
End If
End Sub

This was a small modification of "abu taher"s code which works very well. I just need it to go to the closest match. Thanks "abu taher".