E
Estevan
I have set up a form-based parameter query to search different fileds. The
more fields a user fills in, the more specific the search. My database
searchs a medical journal database. A user can search by: AUTHOR1, AUTHOR2,
AUTHOR3, AUTHOR4, KEYWORD1, KEYWORD2, KEYWORD3, KEYWORD4. However, what if
the user just uses a couple of the above criteria, some of the fields will be
null. Can someone tell me what expression to use in the query to retrieve
records based on the fields indicated by the user? Here is what I have so
far:
SELECT *
FROM ARTICLE
WHERE ((ARTICLE.AUTHOR_1 Like Forms!FIND_ARTICLE!cboAUTHOR1 & '*') And
(ARTICLE.AUTHOR_2 Like Forms!FIND_ARTICLE!cboAUTHOR2 & '*') And
(ARTICLE.AUTHOR_3 Like Forms!FIND_ARTICLE!cboAUTHOR3 & '*') And
(ARTICLE.AUTHOR_4 Like Forms!FIND_ARTICLE!cboAUTHOR4 & '*') And
(ARTICLE.KEYWORD_1 Like Forms!FIND_ARTICLE!cboKEYWORD1 & '*') And
(ARTICLE.KEYWORD_2 Like Forms!FIND_ARTICLE!cboKEYWORD2 & '*') And
(ARTICLE.KEYWORD_3 Like Forms!FIND_ARTICLE!cboKEYWORD3 & '*') And
(ARTICLE.KEYWORD_4 Like Forms!FIND_ARTICLE!cboKEYWORD4 & '*'));
TIA,
Estevan
more fields a user fills in, the more specific the search. My database
searchs a medical journal database. A user can search by: AUTHOR1, AUTHOR2,
AUTHOR3, AUTHOR4, KEYWORD1, KEYWORD2, KEYWORD3, KEYWORD4. However, what if
the user just uses a couple of the above criteria, some of the fields will be
null. Can someone tell me what expression to use in the query to retrieve
records based on the fields indicated by the user? Here is what I have so
far:
SELECT *
FROM ARTICLE
WHERE ((ARTICLE.AUTHOR_1 Like Forms!FIND_ARTICLE!cboAUTHOR1 & '*') And
(ARTICLE.AUTHOR_2 Like Forms!FIND_ARTICLE!cboAUTHOR2 & '*') And
(ARTICLE.AUTHOR_3 Like Forms!FIND_ARTICLE!cboAUTHOR3 & '*') And
(ARTICLE.AUTHOR_4 Like Forms!FIND_ARTICLE!cboAUTHOR4 & '*') And
(ARTICLE.KEYWORD_1 Like Forms!FIND_ARTICLE!cboKEYWORD1 & '*') And
(ARTICLE.KEYWORD_2 Like Forms!FIND_ARTICLE!cboKEYWORD2 & '*') And
(ARTICLE.KEYWORD_3 Like Forms!FIND_ARTICLE!cboKEYWORD3 & '*') And
(ARTICLE.KEYWORD_4 Like Forms!FIND_ARTICLE!cboKEYWORD4 & '*'));
TIA,
Estevan