Search form including a drop down box, keywords and a serach button

  • Thread starter Thread starter Donna Grant
  • Start date Start date
D

Donna Grant

I'm trying to create a custom search box in MS Access 97. I'd like
there to be a drop down list of all the fields, and then a text box
for the user to enter their keyword. Alongside there would be a 'Go'
button which would run the search for the keyword in the selected
field...

I know I will have to create a form with a combo box, a text box and
then SQL query but I'm not sure how to put it all together.

Please help
 
First of all, give everything a name. (The form, the text
box, combo box and button).

Now, create a query in query builder that shows all the
fields you want to show, but also has a WHERE clause that
looks for the value in your drop down box and text box to
get the field nams and criteria (instead of hardcoding).

Save and name this query (eg query1)

Then, add an event to the on click of your button which is

docmd.openquery(query1)

OR... you could have another form which instead of being
linked to a table is linked to the query and it will then
display the results in text boxes.

Hope this points you in the right Direction
 
Back
Top