search for a (any) word in a memo field of a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I hope this is possible.
I would like to create a query which will allow me to have a prompt for a
key word which will be looked up in a memo field of a table and bring up
a/many records which contain that word amoung the sentences/phrases in the
field.
I have been able to create a query which does this, BUT, i have not been
able to create a prompt for this. here is what i have so far:
Like "*see*"
'see' is used as an example and this is found in the criteria line of the
query. I need to be able to:
1. create it so it will prompt me to enter, for example, 4 letters of a word
2. create it so it will look up any 4 letters, I dont want the criteria to
contain specific letters, it must be able to look up any 4 that are keyed in
the prompt window

i tried this:
Like "*????*"=[Enter any 4 letter word/part of word:]

I think this is called a flexible parameter query

But it won't work. I hope someone can understand what I require.
Thank you all for your help in advance.
Kind Regards
Rigby
 
[TheMemoField] Like "*" & [Enter any 4 letters] & "*"

That will match any amount of letters that are input.
You can force no-results to be returned if the user doesn't enter exactly 4
characters by using.
[TheMemoField] Like "*" & [Enter any 4 letters] & "*" And Len([Enter any 4
letters]) = 4

If you need exactly four then you are better off creating a form with a
textbox that you can check the input and a button to open the query using
the textbox as a parameter.
 
Dear John

I got so excited when it worked, I almost forgot to thank you. Thank you! It
worked perfectly. It even does more than I hoped it would, by being able to
enter as many letters as I wished.

Now, believe it or not, I have another related question. Would it be
possible to use the same expression in other memo fields in the same query,
or would I have to create multiple queries? I have 5 memo fields involved
with this query.

Again, a big thank you.
Kind Regards
Rigby

John Spencer said:
[TheMemoField] Like "*" & [Enter any 4 letters] & "*"

That will match any amount of letters that are input.
You can force no-results to be returned if the user doesn't enter exactly 4
characters by using.
[TheMemoField] Like "*" & [Enter any 4 letters] & "*" And Len([Enter any 4
letters]) = 4

If you need exactly four then you are better off creating a form with a
textbox that you can check the input and a button to open the query using
the textbox as a parameter.

rigby said:
Hello

I hope this is possible.
I would like to create a query which will allow me to have a prompt for a
key word which will be looked up in a memo field of a table and bring up
a/many records which contain that word amoung the sentences/phrases in the
field.
I have been able to create a query which does this, BUT, i have not been
able to create a prompt for this. here is what i have so far:
Like "*see*"
'see' is used as an example and this is found in the criteria line of the
query. I need to be able to:
1. create it so it will prompt me to enter, for example, 4 letters of a
word
2. create it so it will look up any 4 letters, I dont want the criteria to
contain specific letters, it must be able to look up any 4 that are keyed
in
the prompt window

i tried this:
Like "*????*"=[Enter any 4 letter word/part of word:]

I think this is called a flexible parameter query

But it won't work. I hope someone can understand what I require.
Thank you all for your help in advance.
Kind Regards
Rigby
 
Sure, if you want to search for the exact same thing in the other memo
fields then copy the criteria exactly and paste it below the relevant
fields. Make SURE you do that on separate criteria rows (if you are using
the grid). If you put the criteria all in the same row then you would have
to have a match in every one of the fields. If you put the criteria in
separate rows, you only have to have a match in at least ONE of the fields.


rigby said:
Dear John

I got so excited when it worked, I almost forgot to thank you. Thank you!
It
worked perfectly. It even does more than I hoped it would, by being able
to
enter as many letters as I wished.

Now, believe it or not, I have another related question. Would it be
possible to use the same expression in other memo fields in the same
query,
or would I have to create multiple queries? I have 5 memo fields involved
with this query.

Again, a big thank you.
Kind Regards
Rigby

John Spencer said:
[TheMemoField] Like "*" & [Enter any 4 letters] & "*"

That will match any amount of letters that are input.
You can force no-results to be returned if the user doesn't enter exactly
4
characters by using.
[TheMemoField] Like "*" & [Enter any 4 letters] & "*" And Len([Enter any
4
letters]) = 4

If you need exactly four then you are better off creating a form with a
textbox that you can check the input and a button to open the query using
the textbox as a parameter.

rigby said:
Hello

I hope this is possible.
I would like to create a query which will allow me to have a prompt for
a
key word which will be looked up in a memo field of a table and bring
up
a/many records which contain that word amoung the sentences/phrases in
the
field.
I have been able to create a query which does this, BUT, i have not
been
able to create a prompt for this. here is what i have so far:
Like "*see*"
'see' is used as an example and this is found in the criteria line of
the
query. I need to be able to:
1. create it so it will prompt me to enter, for example, 4 letters of a
word
2. create it so it will look up any 4 letters, I dont want the criteria
to
contain specific letters, it must be able to look up any 4 that are
keyed
in
the prompt window

i tried this:
Like "*????*"=[Enter any 4 letter word/part of word:]

I think this is called a flexible parameter query

But it won't work. I hope someone can understand what I require.
Thank you all for your help in advance.
Kind Regards
Rigby
 
John
Thanks again. You have been a great help. This should keep me happy for a
while. Have a great weekend.

Rigby

John Spencer said:
Sure, if you want to search for the exact same thing in the other memo
fields then copy the criteria exactly and paste it below the relevant
fields. Make SURE you do that on separate criteria rows (if you are using
the grid). If you put the criteria all in the same row then you would have
to have a match in every one of the fields. If you put the criteria in
separate rows, you only have to have a match in at least ONE of the fields.


rigby said:
Dear John

I got so excited when it worked, I almost forgot to thank you. Thank you!
It
worked perfectly. It even does more than I hoped it would, by being able
to
enter as many letters as I wished.

Now, believe it or not, I have another related question. Would it be
possible to use the same expression in other memo fields in the same
query,
or would I have to create multiple queries? I have 5 memo fields involved
with this query.

Again, a big thank you.
Kind Regards
Rigby

John Spencer said:
[TheMemoField] Like "*" & [Enter any 4 letters] & "*"

That will match any amount of letters that are input.
You can force no-results to be returned if the user doesn't enter exactly
4
characters by using.
[TheMemoField] Like "*" & [Enter any 4 letters] & "*" And Len([Enter any
4
letters]) = 4

If you need exactly four then you are better off creating a form with a
textbox that you can check the input and a button to open the query using
the textbox as a parameter.

Hello

I hope this is possible.
I would like to create a query which will allow me to have a prompt for
a
key word which will be looked up in a memo field of a table and bring
up
a/many records which contain that word amoung the sentences/phrases in
the
field.
I have been able to create a query which does this, BUT, i have not
been
able to create a prompt for this. here is what i have so far:
Like "*see*"
'see' is used as an example and this is found in the criteria line of
the
query. I need to be able to:
1. create it so it will prompt me to enter, for example, 4 letters of a
word
2. create it so it will look up any 4 letters, I dont want the criteria
to
contain specific letters, it must be able to look up any 4 that are
keyed
in
the prompt window

i tried this:
Like "*????*"=[Enter any 4 letter word/part of word:]

I think this is called a flexible parameter query

But it won't work. I hope someone can understand what I require.
Thank you all for your help in advance.
Kind Regards
Rigby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top