Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old May 16th, 2006, 06:05 AM
yourtrashhere@gmail.com
Guest
 
Posts: n/a
Default Searching for words out of older in Access

So basically, what I have is a bunch of words in one memo field, for
example:

dog cat cowboy tree flower

To search it, this is the code I have now.

' Check for LIKE Last Name
If Me.txtLastName > "" Then
varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & "*" * "
AND "
End If

The only problem is what I search for needs to be "in order", for
example, if I search for dog, I'll get the table. But, if I seach for
tree, I won't because tree was not place first. Can you please help me?
Thanks a lot!
Reply With Quote

  #2  
Old May 16th, 2006, 08:15 PM
Arno R
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

I guess you need something like this:

If Me.txtLastName > "" Then
varWhere = "[LastName] LIKE *" & Me.txtLastName & "*"
End If

Arno R

<yourtrashhere@gmail.com> schreef in bericht news:1147755409.221957.208400@i39g2000cwa.googlegr oups.com...[color=blue]
> So basically, what I have is a bunch of words in one memo field, for
> example:
>
> dog cat cowboy tree flower
>
> To search it, this is the code I have now.
>
> ' Check for LIKE Last Name
> If Me.txtLastName > "" Then
> varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & "*" * "
> AND "
> End If
>
> The only problem is what I search for needs to be "in order", for
> example, if I search for dog, I'll get the table. But, if I seach for
> tree, I won't because tree was not place first. Can you please help me?
> Thanks a lot!
> Reply With Quote
>[/color]
  #3  
Old May 16th, 2006, 11:05 PM
yourtrashhere@gmail.com
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

This code does not work.

  #4  
Old May 16th, 2006, 11:35 PM
Randy Harris
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

* yourtrashhere@gmail.com:[color=blue]
> So basically, what I have is a bunch of words in one memo field, for
> example:
>
> dog cat cowboy tree flower
>
> To search it, this is the code I have now.
>
> ' Check for LIKE Last Name
> If Me.txtLastName > "" Then
> varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & "*" * "
> AND "
> End If
>
> The only problem is what I search for needs to be "in order", for
> example, if I search for dog, I'll get the table. But, if I seach for
> tree, I won't because tree was not place first. Can you please help me?
> Thanks a lot!
> Reply With Quote
>[/color]

You haven't provided much information so I suspect this is going to get
you some results that you don't want. But, it should get "tree".

' Check for LIKE Last Name
If Me.txtLastName > "" Then
varWhere = varWhere & "[LastName] LIKE ""*" & Me.txtLastName & "*"" "
End If

If you had both boy and cowboy in the field and you search for boy,
you'd get both. This might do better.

' Check for LIKE Last Name
If Me.txtLastName > "" Then
varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & _
" *"" OR [LastName] LIKE ""* " & Me.txtLastName & "*"""
End If


--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
  #5  
Old May 17th, 2006, 01:25 AM
Lyle Fairfield
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

yourtrashhere@gmail.com wrote in news:1147817129.901123.305520
@i39g2000cwa.googlegroups.com:
[color=blue]
> This code does not work.[/color]

Perhaps, you should look for some paid help. I am guessing our whole group
is sorry and embarrassed for wasting your time.

--
Lyle Fairfield
  #6  
Old May 17th, 2006, 04:25 PM
yourtrashhere@gmail.com
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

Thanks a lot Randy. Sorry for the rude reply. Didn't mean. it.

  #7  
Old May 17th, 2006, 04:35 PM
yourtrashhere@gmail.com
Guest
 
Posts: n/a
Default Re: Searching for words out of older in Access

Actually, would there be a way I can search for multiple terms, out of
order.

Like, so I can search for is a case like:

cat dog bob john whatever

If I search "john bob" I would get that entry?

Thanks.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.