T
timhysniu
Hello group,
I am trying to search using several search keys. In my case I want t
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 ar
sorted by last name first, I am assuming that searching further dow
will find the first name "????". However, the cursor seems to b
starting from the beginning again. Can someone please give me th
simplest approach to do 1 AND Search using 2 columns? (First Name an
Last Name)
Thank You,
ti
I am trying to search using several search keys. In my case I want t
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 ar
sorted by last name first, I am assuming that searching further dow
will find the first name "????". However, the cursor seems to b
starting from the beginning again. Can someone please give me th
simplest approach to do 1 AND Search using 2 columns? (First Name an
Last Name)
Thank You,
ti