How do I create a search form in Access?

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

Guest

I want to create a form that has multiple criteria for people to search by,
which will then link to a filtered version of forms matching their criteria
.... everything I try does not work. Please help of you can
 
Megan;

One method that's worked for me is to:
1) put unbound controls on the form representing the fields the user can
enter for the search;
2) code the query (that is the RecordSource for the search form) so that it
contains one calculated field for each comparison
2a) each calculated field contains an "IIF" comparing the search control
against the actual data in the table
2b) if there is a match, set the result of the "IIF" to "Yes"
2c) otherwise set the result of the "IIF" to "No"
2d) in the Criteria row, enter "Yes"
[the result is that only those rows that meet all the search arguments
will be in the result]
3) but a button on the form
4) after the user enters the information, he/she clicks this button
5) code an OnClick event for the button and in the OnClick event, issue a
DoCmd.Requery so that the query will be executed using the search
information entered by the user.
6) code the appropriate bound controls on the form to display the results.

Bob (@Martureo.Org)
 
Back
Top