Link to home
Start Free TrialLog in
Avatar of tahirih
tahirih

asked on

Access - Cells Containing Key Words

Hi,

Based on Table A and Table B, I will be creating a query wher I will extract from Table B cells that have key words in A.

In Excel, we use "Contains." Is "Like" the only option in Access - i.e. in Design View, under criteria I enter "Like Red" OR "Like Ball."

Thanks
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

create a query like this

select * from tableB, tableA
where TableB.field1 like "*" & tableA.field1 & "*"
Avatar of tahirih
tahirih

ASKER

In Access - how can I create this query so that the output table will be based on a word(s) contained in Table A.

Example - Table A has three rows

"The dog jumps"
"The cat jumps"
"The dog jumps and leaps"

I want to search on "jumps" and "leaps", and the output table should have the first and third statements. "Like" does not work.

Thanks
Avatar of tahirih

ASKER

Sorry - let me clarify, I am only using Table A to generate the output table.

How can I do this in design view?
Avatar of tahirih

ASKER

The code version I have of this is not working either. Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Given your 3 records:

"The dog jumps"
"The cat jumps"
"The dog jumps and leaps"

Searching for "jumps" OR "leaps" would return all records.

Searching for "jumps" AND "leaps" would return one record.

So I'm not sure how you would return only the 1st and 3rd records using the keywords "jumps" and "leaps", unless you also EXCLUDE the keyword "cat".

In other words, you need to more fully define what you want to do.
Avatar of tahirih

ASKER

Thank you