Re: searching memo fields

From: John Spencer (MVP) (spencer4_at_comcast.net)
Date: 12/30/04


Date: Thu, 30 Dec 2004 13:52:19 -0500

One method using a cartesian Join and which may be very slow (UNTESTED and may
be SLOW)

SELECT Distinct Table1.*
FROM Table1, Table2
WHERE Table1.MemoField1 Like "*" & Table2.SpecificNameField & "*"
   OR Table1.MemoField2 Like "*" & Table2.SpecificNameField & "*"

IF you are using the grid to build this
--add the two tables to the grid with NO join between the tables
--set the criteria under memofield1 to
  Like "*" & [Table2].[SpecificNameField] & "*"
--On the next criteria row set criteria under memofield2 to
  Like "*" & [Table2].[SpecificNameField] & "*"

geeksdoitbetter wrote:
>
> Table 1 contains two memo fields which can contian any where from one to 100
> random names over @ 3000 records
>
> Table 2 contains one text field of 300 specific names to search for - i need
> to create a query that will return all records containing a specific name -
> is there a way to automate, so that i'm not manually opening in design view,
> changing the criteria and then running the query 300 times, and then
> repeating for the second memo field?
>
> currently i have: like "*Cool, Joe*" in the criteria for the memo field