Using a check box to filter a combo box

  • Thread starter Thread starter gweasel
  • Start date Start date
G

gweasel

Is it possible to filter a combo box based on a check box - or
multiple check boxes.

I've got combo boxes that list all the standard parts a company has in
their inventory.
[cmb_Parts1] and [cmb_Parts2]
Two boxes, because any single job can require 1 or up to 2 separate
parts.

There are over 100 parts and many are named very similarly - so the
combo box is not user-friendly as is.

I want to have a few options that allow the user to filter the parts
that display in the combo boxes.
[chk_Criteria1] and [chk_Criteria2]

What is the code needed for this and where would I put it? Or is
coding needed at all - maybe a query filter?

I appreciate any help or links to examples/descriptions.

Thanks.
RJB
 
Modify the Row Source for the combo boxes. For example, base the combo box
data on a query (instead of a table) that refers to the check boxes via
something like [Forms]![FormName]![chk_Criteria1]. You did not explain the
logic behind your desired filter so it is unclear how this would be
implemented, but hopefully, you get the idea.
Is it possible to filter a combo box based on a check box - or
multiple check boxes.

I've got combo boxes that list all the standard parts a company has in
their inventory.
[cmb_Parts1] and [cmb_Parts2]
Two boxes, because any single job can require 1 or up to 2 separate
parts.

There are over 100 parts and many are named very similarly - so the
combo box is not user-friendly as is.

I want to have a few options that allow the user to filter the parts
that display in the combo boxes.
[chk_Criteria1] and [chk_Criteria2]

What is the code needed for this and where would I put it? Or is
coding needed at all - maybe a query filter?

I appreciate any help or links to examples/descriptions.

Thanks.
RJB
 
I'll give that a shot. It is sort of what I was thinking, but I wasn't
sure it was possible to base the row source on a query with multiple
filters from multiple objects (check boxes).

As to the filter - I was keeping it simple, didn't think the criteria
was important, just that there were multiple criteria. Also, I didn't
want to start explaining part numbers and names that wouldn't make any
sense to someone not in that industry and would just confuse things.
Basically though, some parts are compatible with model A, some with
Model B, and some Model C. One check box filters out the parts that
don't fit "Model A" and the second one filters out parts that don't
fit "Model B". If both boxes are checked, all that should be left to
choose from are the parts that fit "Model C".




Modify the Row Source for the combo boxes. For example, base the combo box
data on a query (instead of a table) that refers to the check boxes via
something like [Forms]![FormName]![chk_Criteria1]. You did not explain the
logic behind your desired filter so it is unclear how this would be
implemented, but hopefully, you get the idea.


Is it possible to filter a combo box based on a check box - or
multiple check boxes.
I've got combo boxes that list all the standard parts a company has in
their inventory.
[cmb_Parts1] and [cmb_Parts2]
Two boxes, because any single job can require 1 or up to 2 separate
parts.
There are over 100 parts and many are named very similarly - so the
combo box is not user-friendly as is.
I want to have a few options that allow the user to filter the parts
that display in the combo boxes.
[chk_Criteria1] and [chk_Criteria2]
What is the code needed for this and where would I put it? Or is
coding needed at all - maybe a query filter?
I appreciate any help or links to examples/descriptions.
Thanks.
RJB
 
Back
Top