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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to query multiple fields within a table?

Status
Not open for further replies.

IcePak

Technical User
Nov 7, 2001
23
US
Hello everyone,
I'm hoping someone out there can relieve a headache I'm having. I'm relatively new at Access and the help guides are little or no help.
All I'm trying to do is prompt the user for a word or number to query an entire table for. It's along the lines of a search engine...
To further explain, there are multiple fields that have text in them that may correspond to a row a user is looking for, but not necessarily in the exact form. What I mean is, I want this program to search for (for example) the word "hello" throughout the table and return its resulting rows regardless of whether the cell has the exact text "hello" or the phrase "hellothere" or "heyhello".

I've tried using the Like "* *" coding but I haven't been able to get that to work using prompted inputs. I don't even know if there's a way to store the input as a variable. I know that there's got to be an easier way. I want it to work like the built-in "Find" capabilities of excel and access, but be able to apply the results to reports and etc.

Any help anyone can offer this new user would be greatly appreciated.
Thanks
Mike
 
Easy enough!!!

As you're a newbie, I presume you're using query by grid.

So here goes:

In the first column you want to search, put in the criteria:

Like "*" & [Enter Search String] & "*"

Now go to the next column you want to search

Then in the second row of the criterai grid, put the criteria:

Like "*" & [Enter Search String] & "*"


Continue like that for all the fields. Make sure each field you want to search has criteria on a different line. Putting it on a different line makes it an OR. Putting it on the same line make it an AND.

Craig
 
Thanks Craig! It worked and you rock!
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top