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!

Search form (I know there's a thread) but more specific 1

Status
Not open for further replies.

BotCow

Programmer
Jul 10, 2003
58
US
Okay this is a more specific question on a search form. I have it working just fine so that it will search a field that usually contains more than one word (for instance it is a memo field, or a note-to-self field, or any field generally longer than name, last name, or DOB etc). However, it will only search consecutive words or just a single word in the field eg, if I have a memo field that says, "Gatorade rocks in the summer heat," and I search for "Gatorade", it'll find it. If I search for "rocks in the", it will also find it. But if I search for "Gatorade summer", it won't find it. I want the memo field I have to function like a bunch of keywords, any combination of words or strings even closely matching with it will work. Any suggestions?
 
I would use some type of parsing routine. Maybe start with the Mid function. With this you can analyze your search string. Each time you come to a space, break that up with an OR operator.

Thus, you would take "Gatorade summer" and split it up into a new criteria string like so...

strCriteria = "MyField Like '*Gatorade*' OR MyField Like '*summer*'"

This is just the concept and not the actual code.

Hope it gets you going.



ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Yea, that does help a lot, now if I wasn't so darn VBA deprived I would code that in a heartbeat I'm sure. Hrmm, shouldn't be too hard.
 
If you haven't gotten it by Monday morning, email me at the address below with more details and I can probably throw something together.

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top