Hello group,
I am trying to search using several search keys. In my case I want to search by Last Name and First Name.
Heres the code that I am using: (on Query x: Last Name Sorted (ASC), First Name Sorted (ASC) )
DoCmd.ShowAllRecords
DoCmd.GoToRecord , , acFirst
If strLast <> "" Then
DoCmd.GoToControl "Last Name"
DoCmd.FindRecord strLast, acEntire, , acDown, , acCurrent
First_Name.SetFocus
End If
If strFirst <> "" Then
DoCmd.GoToControl "First Name"
DoCmd.FindRecord strFirst, acEntire, , acDown, , acCurrent
End If
What is happening is the Last name "????" is found. Since they are sorted by last name first, I am assuming that searching further down will find the first name "????". However, the cursor seems to be starting from the beginning again. Can someone please give me the simplest approach to do 1 AND Search using 2 columns? (First Name and Last Name)
Thank You,
tim
I am trying to search using several search keys. In my case I want to search by Last Name and First Name.
Heres the code that I am using: (on Query x: Last Name Sorted (ASC), First Name Sorted (ASC) )
DoCmd.ShowAllRecords
DoCmd.GoToRecord , , acFirst
If strLast <> "" Then
DoCmd.GoToControl "Last Name"
DoCmd.FindRecord strLast, acEntire, , acDown, , acCurrent
First_Name.SetFocus
End If
If strFirst <> "" Then
DoCmd.GoToControl "First Name"
DoCmd.FindRecord strFirst, acEntire, , acDown, , acCurrent
End If
What is happening is the Last name "????" is found. Since they are sorted by last name first, I am assuming that searching further down will find the first name "????". However, the cursor seems to be starting from the beginning again. Can someone please give me the simplest approach to do 1 AND Search using 2 columns? (First Name and Last Name)
Thank You,
tim