Key words in query

jon jomaco

Registered User.
Local time
Today, 08:14
Joined
May 20, 2005
Messages
41
I have a table and in there is the names of sandwiches, their prices and also extra info which includes whether the sandwich contains nuts etc. The actual text is "MAY CONTAIN NUTS" . When searching through the query i have made, there is the text - Extra info? for the query criteria or question and then i have to type in what i want to search or query for. Is it possible that i can just use the words 'nuts' when i search and then it will bring up sandwiches which contain the text "MAY CONTAIN NUTS" in the extra info field so that when querying it is much faster to find the sandwiches which contain nuts? If you can do this then please help.
Thanks, jon.
 
Last edited:
You can if you use LIKE "*target*"
I just do not know if you can use something like LIKE "*" & [Enter Search String] & "*"
 
in the criteria what exactly would i put though so i can use "nuts" to bring up "MAY CONTAIN NUTS"
 
where do i type this when i actually do the search or below the criteria in query design mode or something ?
 
Fofa,

Good answer - like "*nuts*" :D

Jon,

make a query

field: YourFieldName
Table: YourTableName
Criteria: Type in Like "*nut*"

hth,
Michael
 
yes but now what ever i type in search it always brings up the sandwiches with the text "MAY CONTAIN NUTS" can i make it so that only when i type nuts or NUTS in the search query it brings up the "MAY CONTAIN NUTS" sandwiches and not all the time.

I think you misunderstood me. For the createria for the "Extra info" field i have a question for the search as in - [ExtraInfo?] - what i want to know is that when i run the query and the search box comes up how do i make it so that when i do this i can type 'nuts' or 'NUTS' in the search box and it will bring up the sandwiches with the text "MAY CONTAIN NUTS"
thanks, hope you can help.
jon.
 
Last edited:
Like "*" & [ExtraInfo?] & "*"

RV
 
man, either i dont understand or you don't know what i mean. right.
I have a table:

table6zm.jpg


Then i made a query with the question shown to be displayed when searching using the query:

query9rr.jpg


When i open the query this search box comes up.

querysearch8qz.jpg


How do i make it so that in the search box above ^^ i can type the word nuts and it will bring up the sandwich with the "MAY CONTAIN NUTS" extra info. (as shown above in the table)

thx, jon.
 
man, either i dont understand or you don't know what i mean

Apparently, it's you not understanding :D
Copy and paste into your criterium:

LIKE "*" & [ExtraInfo?] & "*"

RV
 
yeeeeeeeeeeeeeeeeeeeeeeeeeeeeee thanky you, thank you :DD i am jus stupid sorry, it works now tho cheerz m8 :D

jon.
 
oo jus one problem for some sandwiches there is no data in the extra info field and i dont enter anythin into the search it only displays the ones that hav data in the extra info field how do i stop it doing this so that it displays all the products if i enter nothing in?
 
so now it looks like this:

accessquerycomplete8ds.jpg


Is that correct? it does not seem to work with the price

thx, jon.
 
Last edited:
how do i make it so that the prices can be searched for? because now when i type in a price it jus displays blank table
 
Last edited:
Why don't you create a form rather than using this flawed paramter method? With a form you can put controls on it that allow you to pick your criteria. The query can then refer to the form. There's loads of threads discussing search forms.
 

Users who are viewing this thread

Back
Top Bottom