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

Wildcard Search from a From input

Status
Not open for further replies.

rkdcomp

Instructor
Joined
Jan 29, 2002
Messages
69
Location
US
1. Have a table and want to search a field using a wildcard. No problem, *auto* will produce the desired results.

2. But I need to have the user run the query from a form where he/she would have a control into which they would type AUTO and the query would reference the forms![Form1]![Search] and return all records with AUTO in that field.

3. If I type in the *auto* in the query it works fine.

4. If I use a parameter query in which I use *[enter value]*, it does not open a dialog box to to fill in the parameter, it just returns no records. I used this to test a wildcard parameter and it doesn't work.

5. So if somehow I can get a wildcard parameter query to work, I can ref the form for the value.

Any and all help would be appericated.

Thanks.

Richard in Tulsa
 
Richard:

Add the following to your query criteria parameter:

Like "*[Forms]![NameofForm]![TextboxNameonForm]*"

This should produce the results you need.
 
Didn't work.

I put the
Like "*[Forms]![frmSearch]![Input]*"

n the Query grid and tried it with a value in the form and it returns NO records.

Just opend the Query without the form open and it should act like a parameter query and ask me for a value and it just opens to the result again with NO records.

Still a puzzle??

Richard


 
You need to concatenate the asterisks with the user input:

like "*" & [Forms]![frmSearch]![Input] & "*"

 
annsoloman:

Works like a champ!

Thanks a bunch.

Richard in Tulsa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top