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!

"LIKE" Query from a form

Status
Not open for further replies.

FredPeters

IS-IT--Management
Apr 30, 2002
10
CA
I have a form to receive data(eg car) to use as search criteria for any part of the field. eg. Like *car* to return cargo, transcar, miscarriage etc.

I need to find numbers, letters, etc in the same field. Caps is not an issue.

It is not returning any results.

Help

Fred



 
First, thanks for answering.
Second, sorry Trancend, I dont understand what you mean by pasting a query.

Fred
 
open your query in design view

goto views and select SQL

Copy the text and paste it to your post

(-: Remember amateurs built the ark - professionals built the Titanic

[yoda]
 
AAAHHHHH I get it now....I thought that was the solution. Heres the inoperative query. I've tried moving the astericks around to no avail.

SELECT [2002 Membership].NAME, [2002 Membership].SURNAME, [2002 Membership].ID
FROM [2002 Membership] INNER JOIN [2002 Membership] AS [2002 Membership_1] ON [2002 Membership].ID = [2002 Membership_1].ID
WHERE ((([2002 Membership].SURNAME) Like "* [Forms]![fnamesearch]![txtname]*"));

Thanks All!

Fred
ps. does everybody type there wise saying every post or is there a quick way to enter.

And in the end, The love you get,
Is equal to the love you give.
 
You can use the % sign in a Like Expression. When used in a LIKE expression % is a wild card

eg. LIKE 'Back%';>> returns all occurrences that started with back

LIKE '%Back%';>> return any occurrence in the column


You should note that references to data are always case sensitive. One way around this would be to format all of the names in your table so that they begin with a captial Remember amateurs built the ark - professionals built the Titanic

[yoda]
 
Fred when you add it to the criteria line for a query, you need to use this syntax

Like "*" & Forms!fnamesearch!txtname & "*"

As for the wise saying, I think you go to your personal profile and put it in a signiture box there. I don't know any wise saying so I don't use it.[wink]

Paul
 
Thanks ALL for responding. MazeWorx, I tried yours in different variations to no avail. Paul..yours worked nicely. Again...Thanks ALL!!

Fred

ps. it's nice to know help is out here!
Happy Holidays
 
The diff. between SQL and the SQL(Jet) used in Access Remember amateurs built the ark - professionals built the Titanic

[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top