Finding Multiple Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an unbound text box I use to search for records. Works fine except
when multiple records of the same number are stored in the database. I need a
form that pops up showing the multiple records, allows me to select one, and
then finds the record selected. Any ideas on HOW TO DO?
 
I have an unbound text box I use to search for records. Works fine except
when multiple records of the same number are stored in the database. I need a
form that pops up showing the multiple records, allows me to select one, and
then finds the record selected. Any ideas on HOW TO DO?

Use a continuous Form bound on a query using the textbox as a
criterion; put a command button on the continuous form to open the
current record:

Private Sub cmdGo_Click()
Dim rs As DAO.Recordset
DoCmd.OpenForm "YourDisplayForm" ' if it's not open already
Set rs = Forms!YourDisplayForm.RecordsetClone
rs.FindFirst "[ID] = " & Me!ID
If rs.NoMatch Then
<handle the error condition>
Else
Forms!YourDisplayForm.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub

John W. Vinson[MVP]
 
Back
Top