Key Word Search in a memo field - How To?

  • Thread starter Thread starter Carl
  • Start date Start date
C

Carl

Can anyone explain how I can create a key word search that will look in
my memo fields for a key word, or a string of characters and display
records that have a match? Any help is much appreciated!
 
Carl said:
Can anyone explain how I can create a key word search that will look in
my memo fields for a key word, or a string of characters and display
records that have a match? Any help is much appreciated!


Use the LIKE operator with wildcards.

In a query, set the memofield's criteria:
Like "*keyword*"

If you are trying to fo this for a control on a form:

If Me.memofield Like "*keyword*" Then
 
Marshall,

Thanks for the help here! Do you know how I can set up the query to be
a parameter that the user can define? I'm having trouble with syntax
here.

Thanks!

Carl
 
Assuming the parameter is in a query and it is coming from a
text box on a form, the criteria would be:

Like "*" & Forms!theform.txtkeyword & "*"
 
Marsh,

Thanks again...you truly are the Access MVP. Worked like a charm...one
last question for you. When I input your code, the query works
perfectly but I would like the text to prompt the user with "Enter
Keyword" or something like that. Right now what I get is:

Forms!theform.txtkeyword

Any suggestions?

Carl


Marshall said:
Assuming the parameter is in a query and it is coming from a
text box on a form, the criteria would be:

Like "*" & Forms!theform.txtkeyword & "*"
--
Marsh
MVP [MS Access]

Thanks for the help here! Do you know how I can set up the query to be
a parameter that the user can define? I'm having trouble with syntax
here.
 
It is generally better to use a form for parameters. The
prompt string kind of parameters are best use for quick and
dirty situations such as debugging.

You can get what you asked for by using:

Like "*" & [Enter Keyword] & "*"
 
Thanks...your input has really helped me out! I'm going to have to do
some research on how to use the forms...never had any real access
training (if you can't tell) just trying to give my disfunctional
office a leg up with tracking some basic information. If you have any
website references you would suggest I can use to learn more please
feel free to pass them along! Till then, thanks for your help!

Carl

Marshall said:
It is generally better to use a form for parameters. The
prompt string kind of parameters are best use for quick and
dirty situations such as debugging.

You can get what you asked for by using:

Like "*" & [Enter Keyword] & "*"
--
Marsh
MVP [MS Access]

Thanks again...you truly are the Access MVP. Worked like a charm...one
last question for you. When I input your code, the query works
perfectly but I would like the text to prompt the user with "Enter
Keyword" or something like that. Right now what I get is:

Forms!theform.txtkeyword
 
I think you would be better off getting a book or taking a
course to start. Web sites are not so good at beginner
tutorials.

Once you get the basics under your belt, I suggest that you
start with The Access Web at http://www.mvps.org/access/
You can then follow the links to other sites with still more
information and links than you can reasonanly expect to
absorn. For a specific topic, Google is your friend ;-)
--
Marsh
MVP [MS Access]

Thanks...your input has really helped me out! I'm going to have to do
some research on how to use the forms...never had any real access
training (if you can't tell) just trying to give my disfunctional
office a leg up with tracking some basic information. If you have any
website references you would suggest I can use to learn more please
feel free to pass them along! Till then, thanks for your help!


Marshall said:
It is generally better to use a form for parameters. The
prompt string kind of parameters are best use for quick and
dirty situations such as debugging.

You can get what you asked for by using:

Like "*" & [Enter Keyword] & "*"

Thanks again...you truly are the Access MVP. Worked like a charm...one
last question for you. When I input your code, the query works
perfectly but I would like the text to prompt the user with "Enter
Keyword" or something like that. Right now what I get is:

Forms!theform.txtkeyword


Marshall Barton wrote:
Assuming the parameter is in a query and it is coming from a
text box on a form, the criteria would be:

Like "*" & Forms!theform.txtkeyword & "*"


Carl wrote:
Thanks for the help here! Do you know how I can set up the query to be
a parameter that the user can define? I'm having trouble with syntax
here.


Marshall Barton wrote:
Carl wrote:

Can anyone explain how I can create a key word search that will look in
my memo fields for a key word, or a string of characters and display
records that have a match? Any help is much appreciated!


Use the LIKE operator with wildcards.

In a query, set the memofield's criteria:
Like "*keyword*"

If you are trying to fo this for a control on a form:

If Me.memofield Like "*keyword*" Then
 
Back
Top