Re: 4 combo boxes need and/or query for single or multiple sorts



On Thu, 9 Mar 2006 18:36:28 -0800, Gwen
<Gwen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi,

User needs to be able to sort from any single combo box or any combination
of all 4 boxes

Do you mean "sort" - define the sequential order of the records
returned by a query? or "search" - select which records to display?
I'm guessing you're making the common erroneous use of the term.

The results are displayed in a list box

I have been able to get results where the records have all combinations but
i can't seem to figure how to get single and combination sorts combine to
display.

cbo1: orgs
cbo2: states
cbo3: processes
cbo4: packagaging

For example:
User wants to be see any process w/wo packaging info
if packaging info then user wants to be select from the packaging combo box.

Same for the other combo boxes

Below is one of the criteria (the check box is clear) on the query source
that I am using
IIf(IsNull([Forms]![form1]![cboProcess]),[tmakorgprocess].[processtypeid],[Forms]![form1]![cboprocess])

Try instead using criteria like

=[Forms]![form1]![cboProcess] OR [Forms]![form1]![cboProcess] IS NULL

With four combos this query will get REALLY ugly in query design view
but it should still work.

The alternative is to write VBA code to examine all four combo boxes,
and build up a SQL query string depending on which combo has been
selected.

John W. Vinson[MVP]
.