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

Parameters That Use Wildcards 2

Status
Not open for further replies.

davemib

Programmer
Dec 31, 2002
30
GB
how can i make a query that will use a Parameters and a wild card

parameter = insert contact details

wild could shhould be able to search any part of a name.
 
Hi davemib,

Use ..

[blue][tt]WHERE YourField LIKE "*" & [Enter Contact Details] & "*"[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
nah i tried it and it didnt work - would u mind sending me a sample of it.
 
Here is an example taken from one of my databases

SELECT customers.name
FROM customers
WHERE (((customers.name) Like "*" & [Forms]![FindAlias].[combo0] & "*"));
 
Hi davemib,

I'd rather explore more here in the forum if you don't mind.

1. Exactly what did you try and fail with? What did you enter, and where, and what was the result?

2. Do you want Users prompted for the parameter, or it taken from a Form (as in Elise's example)

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
when u normally input a parameter u put it in like:

[Enter Contact Details]

but when i tried ure example tony in the query builder it dont seem to work - none of the results appear?

Where [Table1]![Name] Like "*" & [Enter Contact Details] & "*
 
Hi davemib,

My apologies if I'm stating the obvious here, but what I posted is part of an SQL statement.

If you are putting it in the Criteria in the Query builder you just want to use ..

[blue][tt]Like "*" & [Enter Contact Details] & "*"[/tt][/blue]

.. and Access fills in the rest in the generated SQL.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top