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

Searching for text within a table field

Status
Not open for further replies.

robojeff

Technical User
Dec 5, 2008
220
US

I have a query which searches a table and displays records that contain text that
is specified in text boxes on a search form.

This works fine for finding the first characters of the fields but how can I change my
query (below) to display all records that contains the string specified in any part of a
field in the table instead of only the first characters?


Code:
SELECT Doc_tbl.Type, Doc_tbl.RefNum, Doc_tbl.CurrRev, Doc_tbl.Title, Doc_tbl.Link
FROM Doc_tbl
WHERE (((Doc_tbl.Type) Like [Forms]![search_frm].[qDocType] & "*") AND ((Doc_tbl.RefNum) Like [Forms]![search_frm].[qDocNum] & "*") AND ((Doc_tbl.CurrRev) Like [Forms]![search_frm].[qDocTitle] & "*"));

Thanks!
 
What about this ?

SELECT Type, RefNum, CurrRev, Title, Link
FROM Doc_tbl
WHERE Type Like "*" & [Forms]![search_frm]![qDocType] & "*" AND RefNum Like "*" & [Forms]![search_frm]![qDocNum] & "*" AND CurrRev Like "*" & [Forms]![search_frm]![qDocTitle] & "*"





Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top