I am using the following code in a form to search for last name. Most of the time the code works just fine and it finds the person I want. But some of the time it does not. For example, I search for Last Name “Swift”. The code will bring me to last name “BAGGETT”. No where in the “BAGGETT” record is there anything close to the name “Swift”. I can’t figure out why the find brings me to that record.
Dim Criteria As String
Dim SearchName As String ' The name to search for.
SearchName = Me.txtNameSearch.Text
Criteria = "[L_Name1] like '" & SearchName & "*'"
Me.RecordsetClone.FindFirst Criteria
Me.Bookmark = Me.RecordsetClone.Bookmark
If I use FindLast instead of FindFirst it works but it brings me to the last record that fits that criteria and I would like to be at the first.
Any help?
Dim Criteria As String
Dim SearchName As String ' The name to search for.
SearchName = Me.txtNameSearch.Text
Criteria = "[L_Name1] like '" & SearchName & "*'"
Me.RecordsetClone.FindFirst Criteria
Me.Bookmark = Me.RecordsetClone.Bookmark
If I use FindLast instead of FindFirst it works but it brings me to the last record that fits that criteria and I would like to be at the first.
Any help?