Form Search - Based upon multiple combo boxes
A note about the queries used in
this db In order to
retain their simplified SQL, which is easier to understand, the following
queries should not be opened in query design grid view.
(a) Q_Books
(b) Q_LookUpAuthor_A
(c) Q_LookUpYear_A
(If any of these queries gets opened in
design grid view, Access will convert the SQL into bloated state that would
be difficult to follow / understand)
Back-up copies of these queries have been included with
the prefix "ZZZ_", so that if you do happen to land into design grid view
of the original query, leading to its distortion (though OK from performance
point of view), you can restore the original state, by copying from the ZZZ_
version of that query.
For adding further combo boxes in the search
criteria, sample building block to be included in continuation of Where
clause is:
And ((FieldName Like [Forms]![F_Search]![CboName]) Or
(Trim([Forms]![F_Search]![CboName])= "ALL"))
Simultaneously, the following sample component will get
added to PARAMETERS clause, just before the semicolon:
, [Forms]![F_Search]![CboName] Text ( 255 )
Note - In the Lookup Lists for combo
boxes, " ALL" has a leading space so as to
ensure that this option is at top of the list. (Select it in full, including the leading space, when manually replacing by
a direct entry)