Two combo combo boxes on form to select specific report

G

Guest

Hi,

I have two combo boxes on a form and a command button that runs a report.
The first combo box is called ComboCategory and the second if called
ComboProtocol. They are each based on a query that lists the various
categories and protocols. The report is based on a query that has a couple
field that includes Category and Protocol and each have some code in the
criteria section of the design layout that looks like the following for
category.

Like
IIf(IsNull([Forms]![SelectFacial]![ComboCategory]),"*",[Forms]![SelectFacial]![ComboCategory])

The code in the criteria section for Protocol looks like

Like
IIf(IsNull([Forms]![SelectFacial]![ComboProtocol]),"*",[Forms]![SelectFacial]![ComboProtocol])

What I would like to do is to somehow subset things on my form. Right now I
can select the category using the ComboCategory drop down and choose a
category. What I would then like to do is to click the drop down for
protocol and only get those protocols in the category I selected. Right now
I get all protocols from all cateogories. Is there a way to restrict my
selection so that I only get the protocols from the category I selected in my
ComboCategory combo box?

Thanks,
 
B

Barry Gilbert

I assume that the source table of the query for the Protocol combobox
has a category column. In the Protocol combobox's query, add the
following to the criteria line under the Category column:

=Forms![SelectFacial]![ComboCategory]

This will restrict the second combo to records with the category
selected in the first. This also assumes that a category needs to
always be selected first.

HTH,
Barry Gilbert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top