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

Using a "Like" statement, or just use a wildcard? 1

Status
Not open for further replies.

mdweezer

Technical User
Jun 15, 2004
56
US
I have a form full of controls that will be used to trigger a report and based on the information on the form will determine which records show up on the report.
ex) type in the date due and reports with that due date show up, simple stuff =)

Anyway, 3 of my search criterias are text boxes that are 3 strings.

I know in mySQL there is a "like" function so I could find records where such and such a field is "like" string1.

The fields I am comparing to them I believe are memo's.

Whats the easiest way to do this?

Thanks in advance!
 
Something like this ?
sCriteria = "[memo field] Like '*" & Me![textbox] & "*'"
If the underlaying tables aren't ms-access you have to use % as wildchar instead of *

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
My result code that works like a charm!!!!
Code:
qry = qry & "WHERE (((TBL_Items.Item) LIKE '*" & TitleValue & "*'));"

Thanks a lot! You get a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top