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

Query as a search function

Status
Not open for further replies.

Mashieman9

Technical User
Jul 16, 2003
9
0
0
US
It seems to me that using a query as a search function in Access (97) is a great idea. So far Access has yet to agree with me. I've been trying to figure out how to put in a word that will prompt me to enter a value. But of course when I put a word inbetween the quotations (because I want a specific field to be 'like' a given word) of course is just goes for whatever I type in. Any suggestions, other than just to use the Access search feature? Thanks

--
N.Hunt
 
Why don't you just write a query that uses like and prompts for a parameter? Doesn't that do what you're asking for?
 
N.Hunt,
If you want to have a query that asks you for input, then uses your input with the like operator, just use this form:

SELECT CUST.*
FROM CUST
WHERE (((CUST.L_NAME) Like [enter name] & "*"));

The criteria line of this query in design view is:
Like [enter name] & "*"

Of course, if you want to mask both sides, you could say:
Like "*" & [enter value] & "*"

That's the same thing lespaul said, but I thought you might be curious about how to deal with the asterisk(s).

Tranman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top