B
BlueWolverine
Hello,
I am having some problems with my search panel in Access 03 on XP Pro.
I have five fields to allow the user to search for any number (up to )
different things that might be in the field "Work Element Description".
I have a check box for wether they use AND or OR logic for the combination
of the five boxes.
My problem is how to handle Nulls. Most of the time they won't use five
fields, so 3-4 of them will usually be null. How do I Handle those?
OR logic is easy, it's five lines under the WED in design mode. AND is a
bigger problem. Here is the SQL.
SELECT q_search_exact.DayOfWeek, q_search_exact.Fleet_Activity,
q_search_exact.BinstoOther, q_search_exact.[CCC's], q_search_exact.VFG,
q_search_exact.VRT, q_search_exact.[GQRS CAT], q_search_exact.ACTION,
q_search_exact.[Work Element Description], q_search_exact.Frequency,
q_search_exact.[WES#], q_search_exact.Source, q_search_exact.ID,
q_search_exact.[Work Element Description], q_search_exact.[Work Element
Description], q_search_exact.[Work Element Description]
FROM q_search_exact
WHERE (((q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED1] & "*" And (q_search_exact.[Work Element
Description]) Like "*" & [Forms]![f_SearchPanel]![WED2] & "*" And
(q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED3] & "*" And (q_search_exact.[Work Element
Description]) Like "*" & [Forms]![f_SearchPanel]![WED4] & "*" And
(q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED5] & "*"));
It works for 4 nulls and a valid search, but when I replace a null with a
distinguishing second seach term, it returns the results of the first search.
Any ideas?
I am having some problems with my search panel in Access 03 on XP Pro.
I have five fields to allow the user to search for any number (up to )
different things that might be in the field "Work Element Description".
I have a check box for wether they use AND or OR logic for the combination
of the five boxes.
My problem is how to handle Nulls. Most of the time they won't use five
fields, so 3-4 of them will usually be null. How do I Handle those?
OR logic is easy, it's five lines under the WED in design mode. AND is a
bigger problem. Here is the SQL.
SELECT q_search_exact.DayOfWeek, q_search_exact.Fleet_Activity,
q_search_exact.BinstoOther, q_search_exact.[CCC's], q_search_exact.VFG,
q_search_exact.VRT, q_search_exact.[GQRS CAT], q_search_exact.ACTION,
q_search_exact.[Work Element Description], q_search_exact.Frequency,
q_search_exact.[WES#], q_search_exact.Source, q_search_exact.ID,
q_search_exact.[Work Element Description], q_search_exact.[Work Element
Description], q_search_exact.[Work Element Description]
FROM q_search_exact
WHERE (((q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED1] & "*" And (q_search_exact.[Work Element
Description]) Like "*" & [Forms]![f_SearchPanel]![WED2] & "*" And
(q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED3] & "*" And (q_search_exact.[Work Element
Description]) Like "*" & [Forms]![f_SearchPanel]![WED4] & "*" And
(q_search_exact.[Work Element Description]) Like "*" &
[Forms]![f_SearchPanel]![WED5] & "*"));
It works for 4 nulls and a valid search, but when I replace a null with a
distinguishing second seach term, it returns the results of the first search.
Any ideas?