Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable searching vs specific searching 1

Status
Not open for further replies.

defosset

Programmer
Apr 1, 2003
48
US
when i have my querys search they need the whole sring of information how can i get it to where all they need is partial information and they can search and return data, right now when you search using partial it returns nothing but if your specific it will return answer

ie album name search: Passion - Hymns Ancient & modern

it will pull up

but if you do: Hymns Ancient & Modern it pulls nothing
nothing

what setting do i need to change in my query to make it see partial search strings and return results
 
Use "Like" in your query.
Like "*" & [Enter Search Text] & "*"

I recommend allowing the user to search for text entered into a text box on a form.
Like "*" & [Forms]![frmYourForm]![txtSearch] & "*"

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
that will work, tell me how do I set up a form using that query, when Irun the query it pops the dialouge box how do i diable the dialouge box and instead embed it into tthe form so it does not pop up and have that search box display in a subform table. Iknow how get the sub form set but I dont know how to relate the seach box to the sub form.

Nick
 
I don't understand how your forms are set up. You mention a subform but I don't know anything about your main form or subform.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
dehookum:
I think defosset is getting the default dialogue box asking for a query parameter. He wants to eliminate that popup.

defosset:
dehookum's example contains your answer. To implement his solution, create form named X with a text field named Y. Y would contain the user's input. For example, they might type "passion". The select query should have this parameter~

Like "*" & [Forms]![X]![Y] & "*"

The operator "like" tells the computer to use wildcards. The wildcard "*" means "any value or no value". So this query would return "The Passion of the Christ" or "Passions" but not "Passirrions".
 
this did not work as it still came back with a blank query
what would my next step be.

thanks
 
Do you realize that the form must be open prior to running the query?

I don't think you have provided enough information.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top