G
Guest
Hi all,
I have the following select statement for a search form in Access:
SELECT ToPrint.[box #], ToPrint.[MATH AREA], ToPrint.topics,
ToPrint.Activity, ToPrint.[More info], ToPrint.Source
FROM ToPrint
WHERE (((ToPrint.[MATH AREA]) Like ([Forms]![Search]![Keyword]))) OR
(((ToPrint.topics) Like ([Forms]![Search]![Keyword]))) OR
(((ToPrint.Activity) Like ([Forms]![Search]![Keyword]))) OR (((ToPrint.[More
info]) Like ([Forms]![Search]![Keyword]))) OR (((ToPrint.Source) Like
([Forms]![Search]![Keyword])));
When running the search, the query returns results only if the keyword is in
the first field and ignore all other fields... for example, Math Area has
"Geometry" so if the Key word is Geometry, the query returns values, if the
keyword is something in other fields, the query is blank. Also, if the
keyword is "Geo", the query is also blank... I tried using the % truncation
or wild card, but same results.
Can anyone tell me what is wrong in my SQL statement??
P.S. All fields used in the statement are indexed.
Thank you.
Einy
I have the following select statement for a search form in Access:
SELECT ToPrint.[box #], ToPrint.[MATH AREA], ToPrint.topics,
ToPrint.Activity, ToPrint.[More info], ToPrint.Source
FROM ToPrint
WHERE (((ToPrint.[MATH AREA]) Like ([Forms]![Search]![Keyword]))) OR
(((ToPrint.topics) Like ([Forms]![Search]![Keyword]))) OR
(((ToPrint.Activity) Like ([Forms]![Search]![Keyword]))) OR (((ToPrint.[More
info]) Like ([Forms]![Search]![Keyword]))) OR (((ToPrint.Source) Like
([Forms]![Search]![Keyword])));
When running the search, the query returns results only if the keyword is in
the first field and ignore all other fields... for example, Math Area has
"Geometry" so if the Key word is Geometry, the query returns values, if the
keyword is something in other fields, the query is blank. Also, if the
keyword is "Geo", the query is also blank... I tried using the % truncation
or wild card, but same results.
Can anyone tell me what is wrong in my SQL statement??
P.S. All fields used in the statement are indexed.
Thank you.
Einy