View Single Post
  #10  
Old May 25th, 2010, 05:48 AM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default parameter for text

Post the SQL of your query by opening in design view, click on VIEW - SQL
View, highlight all, copy, and paste in a post.

--
Build a little, test a little.


"sebastico" wrote:


Karl
With your parameter:
If I enter one word (any stored in the table), the parameter displays all
records (same as I have in the table).
If I enter two words displays all records as well.


"KARL DEWEY" wrote:

I missed this one.

Place [Forms].[Form].[txtWords] in the field row of the query design grid.

In the criteria row put --
Like "*" & [YourTableName].[FieldBeingSearched] &"*"


--
Build a little, test a little.


"sebastico" wrote:


Karl

Thanks for your reply.
I'm sorry. I wrote the instruction wrong. It must be:
Like [Forms].[Form].[txtWords]&"*"
Nevertheless, as you suggested I tested again:

Like "*" & [Forms].[Form].[txtWords] &"*" .
If I enter one word it works but If I enter two words separated by space,
query shows nothing. I don't know why.

Any idea is welcome


"KARL DEWEY" wrote:

I would suggest separating by space and using this --
Like "*" & [Froms].[Form].txtWords] &"*"

Remember that when you type in 'bell' you will also get 'bellows' in the
results.

--
Build a little, test a little.


"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

Many thanks