Parameter Query and Criteria

  • Thread starter Thread starter Comancheace
  • Start date Start date
C

Comancheace

Hi. I wanted to know if anybody knows what can i put in
criteria to do a parameter query that searches a field
when you input a phrase. For example: I used this:
Like "*" & [Enter your username] & "*" and it works fine
for searches, but it only works if you input one word.
For many words it doesn´t work. Does anybody knows a
criteria that works with phrases or groups of words? For
example i have a table with usernames. If i put this
criteria and if you input John it appears all Johns in a
certain field. But if you are looking for just one
particullary like John Mcnroe Edwood Stewart you can´t
find it. I tried a thing that worked a little i putted
Like "*" & [Enter your username first name] & "*" And
Like "*" & [Enter your username lastname] & "*" and it
worked a little but for that you have to input separately
to names and then the program finds a name matching with
those to names. But now i have a list of products that
have repeated names and when you do that you get a lot of
results in your query and i wanted just one, the one im
looking for. Is there a way of using a criteria similar
to this or not, that you can input a phrase and the query
searches it for you? Thanks.
 
What I do is create a Table with the names in it,Surname then Initial i.e.
Hollywood P.Then create a Form with a Combo Box for the Officers name and a
Subform with the maindata table below. If you set it up right when the user
selects a name from the drop down the details for that person show in the
Subform.

Bruce
 
Hi. I wanted to know if anybody knows what can i put in
criteria to do a parameter query that searches a field
when you input a phrase. For example: I used this:
Like "*" & [Enter your username] & "*" and it works fine
for searches, but it only works if you input one word.

Well, to search for an *exact* phrase this should work fine. If you
search for "small, medium and large" and the memo or text field that
you're searching contains the literal text string "small, medium and
large" it will find it.

What it won't find is variants on the phrase: "small, medium, and
large" won't be found because it has one extra comma, for example.

It sounds like you're looking for a free-text search, which has all
sorts of other complexities. What is the nature of the data that
you're searching? Is it a controlled vocabulary, or is it really
completely free both in the content of the field and the criteria?

John W. Vinson[MVP]
 
You are right. I am looking for a free-text search like google for example.
I am making a database for animal food. And we sell 462 types of food wich
is a great variety and with complex names. For example there is a food
called: Eukanuba Puppy & Junior Small. I wanted for example to put in the
parameter query dialog box: Puppy Junior Small and it would find it for me.
I wanted like you said, not to write the exactly phrase but something
similar because its hard to write the exactly phrase. I wanted to write
just key words and it would find it for me. Is it possible? Thanks.
 
I think thats a simple but great idea. Can you explain it better? Thanks.
 
Back
Top