473,500 Members | 1,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Like for Multiple Word Searches

I've been searching for days, using MS help and I can't find the answer
on my own.

I have this code in my Access Form:

If Not IsNull(Me.txtFilterDescriptionMatName) Then
txtFilterDescriptionMatName =
Replace(txtFilterDescriptionMatName, Chr$(34), Chr$(34) & Chr$(34))
StrWhere = StrWhere & "([DescriptionMatName] LIKE ""*" &
Me.txtFilterDescriptionMatName & "*"" ) AND "
It works well and pulls up all the rows based on a "one word" search,
but if I use 2 or more words I get zero results. Is there any way to
have the cabability to have my people search for more then 1 word and
get the results: IE: Search for Orange Shoes (and the description
DescriptionMatName field has "Orange Leather Tossle Shoes" show up in
the results.
Right now if I search for Orange or Shoes this result would come up.

Thank you.

TraceyDee

Oct 13 '06 #1
3 2832
td********@qosina.com wrote:
I've been searching for days, using MS help and I can't find the answer
on my own.

I have this code in my Access Form:

If Not IsNull(Me.txtFilterDescriptionMatName) Then
txtFilterDescriptionMatName =
Replace(txtFilterDescriptionMatName, Chr$(34), Chr$(34) & Chr$(34))
StrWhere = StrWhere & "([DescriptionMatName] LIKE ""*" &
Me.txtFilterDescriptionMatName & "*"" ) AND "
It works well and pulls up all the rows based on a "one word" search,
but if I use 2 or more words I get zero results. Is there any way to
have the cabability to have my people search for more then 1 word and
get the results: IE: Search for Orange Shoes (and the description
DescriptionMatName field has "Orange Leather Tossle Shoes" show up in
the results.
Right now if I search for Orange or Shoes this result would come up.

Thank you.

TraceyDee
If you have "Like *Apples* And Like "*Oranges* then your probleem is the
word AND. You only want a hit on 1 of the multiple words...not each and
every word...so you use the word OR. "Like *Apples* Or Like "*Oranges*
Oct 13 '06 #2
I replaced the AND with OR and I get an error. I assume that you were
referring to replacing the AND in the code so searching for more then 1
word, I would get results?
salad wrote:
td********@qosina.com wrote:
I've been searching for days, using MS help and I can't find the answer
on my own.

I have this code in my Access Form:

If Not IsNull(Me.txtFilterDescriptionMatName) Then
txtFilterDescriptionMatName =
Replace(txtFilterDescriptionMatName, Chr$(34), Chr$(34) & Chr$(34))
StrWhere = StrWhere & "([DescriptionMatName] LIKE ""*" &
Me.txtFilterDescriptionMatName & "*"" ) AND "
It works well and pulls up all the rows based on a "one word" search,
but if I use 2 or more words I get zero results. Is there any way to
have the cabability to have my people search for more then 1 word and
get the results: IE: Search for Orange Shoes (and the description
DescriptionMatName field has "Orange Leather Tossle Shoes" show up in
the results.
Right now if I search for Orange or Shoes this result would come up.

Thank you.

TraceyDee
If you have "Like *Apples* And Like "*Oranges* then your probleem is the
word AND. You only want a hit on 1 of the multiple words...not each and
every word...so you use the word OR. "Like *Apples* Or Like "*Oranges*
Oct 13 '06 #3
td********@qosina.com wrote:
I replaced the AND with OR and I get an error. I assume that you were
referring to replacing the AND in the code so searching for more then 1
word, I would get results?
salad wrote:
>>td********@qosina.com wrote:

>>>I've been searching for days, using MS help and I can't find the answer
on my own.

I have this code in my Access Form:

If Not IsNull(Me.txtFilterDescriptionMatName) Then
txtFilterDescriptionMatName =
Replace(txtFilterDescriptionMatName, Chr$(34), Chr$(34) & Chr$(34))
StrWhere = StrWhere & "([DescriptionMatName] LIKE ""*" &
Me.txtFilterDescriptionMatName & "*"" ) AND "
It works well and pulls up all the rows based on a "one word" search,
but if I use 2 or more words I get zero results. Is there any way to
have the cabability to have my people search for more then 1 word and
get the results: IE: Search for Orange Shoes (and the description
DescriptionMatName field has "Orange Leather Tossle Shoes" show up in
the results.
Right now if I search for Orange or Shoes this result would come up.

Thank you.

TraceyDee

If you have "Like *Apples* And Like "*Oranges* then your probleem is the
word AND. You only want a hit on 1 of the multiple words...not each and
every word...so you use the word OR. "Like *Apples* Or Like "*Oranges*

Yes. And you'd reference with the field to search. With my example, I
simple used apples and oranges, no field mentioned, and didn't use
quotes. You have to create a string that makes sense.

ALso, enter
Debug.Print strWhere
and go into the Debug window and see what values you have for strWhere.
You could create a query and then do a ViewSQL and paste the strWhere
value into the query. That will let you see what's wrong.
Oct 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1859
by: googleboy | last post by:
Hi there. I have defined a class called Item with several (about 30 I think) different attributes (is that the right word in this context?). An abbreviated example of the code for this is: ...
9
1828
by: Nathan Sokalski | last post by:
I am trying to do a database search using LIKE using the following code: Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click If...
8
1646
by: DQ dont quit | last post by:
I'm currently working on a ASP.Net / C# / SQL 2000 project that involves the entering of keywords, that a web user enters, and then searching MSWord documents for those words. This information...
4
11208
by: jmdaviault | last post by:
I want to do the equivalent of SELECT id from TABLE WHERE text='text' only fast solution I found is: SELECT id,text from TABLE WHERE MATCH(text) AGAINST('value' IN BOOLEAN MODE) HAVING...
5
3062
by: Carstonio | last post by:
I use ASP to display links to Word documents on an intranet. Is there a way in ASP to do text searches on the documents' contents? I want the results to have the link to the Word document plus two...
5
18097
by: whitsey | last post by:
Here is what I have: SELECT (SELECT COUNT(*) AS SEARCHES FROM SEARCHES INNER JOIN GROUPS ON SEARCHES.SITE_ID = GROUPS.SITE_ID WHERE
1
1957
by: icfai | last post by:
hi friends.... I have got a problem regarding loading of multiple assemblies, actually its required for an editor which implements the intellisenseas in vb or dotnet. for that it is required to...
6
3514
by: lawrence k | last post by:
Wierd. Go to this page: http://www.ihanuman.com/search.php and search for "yoga" This query gets run: SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga') ORDER BY id DESC
11
2107
by: grantstech | last post by:
I have successfully created a program that searches for a word in multiple files but now I need to be able to search by more than one word. I have add code from a previous discussion to my original...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.