Searching records

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

Guest

Can anyone point me toward a way of searching records that will mimic the
find/replace method, but without the replace? I don't want to sort the
records, but simply (or maybe not so simply) search on any one of three
fields in a form by typing into a search field to bring up the desired record.

Thanx,

Rip
 
Where are your results being returned? You will have to use a form to run
this search, and you will probably want a sub-form that is set to data-sheet.
The main form is for the search field and the search button. Then the
search button updates the sub-forms recordset with a query that goes
something like
select * from tblTable where
Field1 = me.txtSearchField or
Field2 = me.txtSearchField or
Field3 = me.txtSearchField

This is a generic SQL statement, not just because I don't know the table
name, but because you will have to use the expression builder within the
sub-form in order to get the proper syntax to reference the main form from
within the subform. I suspect it instead of me.txtSearchField you would do
frmMainFormName.txtSearchField, but using the expression builder will get you
exactly the right syntax
 
Can anyone point me toward a way of searching records that will mimic the
find/replace method, but without the replace? I don't want to sort the
records, but simply (or maybe not so simply) search on any one of three
fields in a form by typing into a search field to bring up the desired record.

Thanx,

Rip

Create a Query based on your table, with criteria such as

=Forms!nameofform!nameofcontrol

to search for records with the value in this control.


John W. Vinson[MVP]
 
Back
Top