View Single Post
  #8  
Old May 25th, 2010, 02:38 AM posted to microsoft.public.access.queries
sebastico
external usenet poster
 
Posts: 74
Default parameter for text


Bob

The field I'm searching has one or more words. Can I enter one, two or three
words or do I have to use more txtboxes?
Thank you for your help
"Bob Barrows" wrote:

sebastico wrote:
In Access 2003.
In a form I have a parameter to search for a word at a a time
Like [Froms].[Form].txtWords]&"*" which works well.
.
In order to enter more than two oarameter separated by commas in
txtwords I have been tryin the Str function like this
"Instr([txtWords])"
"Instr[txtWords]"

The query displays no records at all.

Could you suggest me how to do it

I don't think it's doable. If the field you were searching contained
only single words and you were trying to match the entire word, the
Instr solution can work. But since you are doing pattern-matching using
LIKE, there is no way to search for multiple patterns without using OR
to combine them:

Like [txtword1] & "*" OR Like [txtword2] & "*"

It appears you will need to provide multiple textboxes and instruct the
users to enter a single search pattern into each.

--
HTH,
Bob Barrows


.