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

Searching from start of words 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I was just wondering. I have a query that finds records against what is entered in a search box. It works okay, but responds as letters are typed in it produces searhed records even if the input gets matched to the middle of an item.

Example, John, James, Brian is in the field.

If I type in oh, then the record above would appear in my list. Is there any way to change it so it would retrieve records only if I had typed Jo, Ja or Br.

Just a thought as it would make searching far better. Thanks
 
Sorry, forgot to add code.

Me!L2.RowSource = "SELECT DISTINCT C.NNAME AS Player, M.SportorSports AS Sport" _
& " FROM TXMASTERS M INNER JOIN TXCLIPS C ON M.ID1 = C.ID1" _
& " WHERE M.SportorSports Like [FORMS]![NewQuerysForm]![LNAME].[CAPTION]" _
& " AND C.NNAME Like '*" & Me![T2].Text & "*'" _
& " ORDER BY 1"
 
& " AND (C.NNAME Like '" & Me![T2].Text & "*' OR C.NNAME Like '*, " & Me![T2].Text & "*')" _

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV That was perfect, the query runs so much better. I really appreciate the help you give me and many others. Thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top