Search Engine

A

Arvin Meyer

eagles73 said:
i need help in developing a multi-field search for my database.

It's not clear if you want to search 1 criteria in multiple fields or
separate criteria in each field. If the latter, have a look in the help
files for "Filter By Form".

For searching a single criteria in multiple fields try something like:

SELECT [Field1],[Field2],[Field3],[Field4]
FROM [tblYourTable]
WHERE (([tblYourTable].[Field1] Like "*" & [Forms]![frmExample]![txtSearch]
& "*" Or [Forms]![frmExample]![txtSearch] Is Null)) OR
(([tblYourTable].[Field2] Like "*" & [Forms]![frmExample]![txtSearch] & "*"
Or [Forms]![frmExample]![txtSearch] Is Null));
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
J

John Vinson

i need help in developing a multi-field search for my database.

Access queries can search dozens of fields. What problem are you
having? What's the structure of your data? How do you want to do the
search?

John W. Vinson[MVP]
 
E

eagles73

Actually i want to use a text box to enter keywords and search those keywords
on my table that has a keywords field. After entering whatever keywords
typed then the records with that keyword or similar to would display. i hope
i made sense.



Arvin Meyer said:
eagles73 said:
i need help in developing a multi-field search for my database.

It's not clear if you want to search 1 criteria in multiple fields or
separate criteria in each field. If the latter, have a look in the help
files for "Filter By Form".

For searching a single criteria in multiple fields try something like:

SELECT [Field1],[Field2],[Field3],[Field4]
FROM [tblYourTable]
WHERE (([tblYourTable].[Field1] Like "*" & [Forms]![frmExample]![txtSearch]
& "*" Or [Forms]![frmExample]![txtSearch] Is Null)) OR
(([tblYourTable].[Field2] Like "*" & [Forms]![frmExample]![txtSearch] & "*"
Or [Forms]![frmExample]![txtSearch] Is Null));
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Top