Hi ….
Your key word needs to be in a variable and the statement would look something like this.
Search_Var = “RPG”
SELECT Field1, Field2, Field3
FROM Tab_Name
WHERE
Field1 LIKE “’*” & Search_Var & “*’”
OR
Field2 LIKE “’*” & Search_Var & “*’”
OR
Field3 LIKE “’*” & Search_Var & “*’”
The * is a wildcard symbol and it different from database to database type. Check to see what Access uses. Don’t forget any string needs a single quote around it.
This is from a PHP \ MySQL application of mine but it should be easy to adapt it for your own purposes.
SELECT * FROM contacts WHERE name LIKE '%$keyword%'
OR telephone LIKE '%$keyword%' OR fax LIKE '%$keyword%'
OR email LIKE '%$keyword%' OR address LIKE '%$keyword%'
OR website LIKE '%$keyword%' OR comments LIKE '%$keyword%'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.