Searches

  • Thread starter Thread starter Tottiescones
  • Start date Start date
T

Tottiescones

Guest
wonder if you can help me.. I am designing a database and I want to add a search function so the user can recall specific records. I have made a parameter query and this works fine but I want it to find records even if the user does not enter the full field name. E.g. if the user enters 'acc' as the search criteria all records with the word 'access' will be displayed. Is this possible to do?
 
I have designed a form where the user inputs the search criteria into a text box and then clicks a button. The button opens a new form showing all records based on what is entered in the text box. It works fine if they input the exact information that was entered in the table intially. Some of my records however have six or seven words in the field and I don't want the user to have to enter all the words just one or two.
 
Place this parameter in the criteria line of a query:

Like "*" & [Put your text here] & "*"

Hope this helps !1

Bob in Indy
 
Thank you so much. I had a feeling it would be a simple piece of coding and it has been annoying me for so long.

Here comes the but...

How would I incorporate this into a form so that the user inputs the search criteria into a text box and pushes a button to open another form showing the results?

As you may have guessed I am fairly new to databases and I am sure most of you think these questions are really stupid ones, but my motto: if you don't ask you don't find out.
 
Last edited:
I don't know if you have been able to do it yourself but let me explain it.

First you need to create a form with all the fields you want to display. The form should be based on the same query which you are going to use for parameters. For example [FormDisplay] is created for display purpose and another form [Form2] is created for parameters. To display [FormDisplay] create a Command Button on [Form2] to display [FormDisplay] upon clicking it. Then write the following syntax against criteria in your query:

Like "*" & [Forms]![Form2]![NameOfTextBox] & "*"

I hope it will solve your problem!
 

Users who are viewing this thread

Back
Top Bottom