I do three types os searches or 'picks' that you should consider. One is to enter a form textbox with enough of the leading characters to make the search unique. The I use the following code.
Private Sub cmdFyndr_Click()
Dim rs As Object, db As Database, str1 As String
If Me.txtFyndr = Null Then Exit Sub
Set db = CurrentDb()
Set rs = Me.RecordsetClone
rs.MoveLast: rs.MoveFirst
str1 = Me.txtFyndr
Do While Not rs.EOF
If rs!LName >= str1 Then
Exit Do
End If
rs.MoveNext
Loop
Me.txtFyndr = ""
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
rs.close
set rs = nothing
db.close
set db = nothing
This will kick me out at the first value greater than my input. I do have to have SELECTED the records in an ORDER
This is what the RECORD SOURCE is in the form:
SELECT HHOLD.HID, HHOLD.LName, HHOLD.FName, HHOLD.Salu, HHOLD.Addr, HHOLD.City, HHOLD.ST, HHOLD.ZIP, HHOLD.Phone1, HHOLD.Phone2, HHOLD.NewsLtr, HHOLD.IsChurch, HHOLD.IsOrg, HHOLD.email, HHOLD.Code
FROM HHOLD
ORDER BY HHOLD.LName, HHOLD.FName;
The second way is similar except it uses "INSTR" to find imbedded code in a field.
The third way is a combo box.
The combo box data source looks like this:
SELECT PkgNamLst.PID, PkgNamLst.PName
FROM PkgNamLst
ORDER BY PkgNamLst.PName;
Then an even "afterupdate" calles the following code.
Private Sub Combo8_AfterUpdate()
Dim db As Database, ps As Object, SSQL As String
Me.txtPID = Me.Combo8
SSQL = "SELECT * FROM PkgNamLst WHERE PkgNamLst.PID = "
SSQL = SSQL & Me.txtPID & ";"
'MsgBox SSQL
Set db = CurrentDb()
Set ps = db.OpenRecordset(SSQL)
Me.txtPName = ps.PName
Me.txtNumRms = ps.Rooms
Me.txtNumTics = ps.Tics
Me.txtNumAtTbl = ps.AtTbl
ps.Close
Set ps = Nothing
db.Close
Set db = Nothing
End Sub
Using the combo box I just click to set focus and then type in enough letters to "find." it.
Hope this helps.
Rollie