How can I limit a COMBO BOX's selections based on a previous form entry

  • Thread starter Thread starter Russell Duncan
  • Start date Start date
R

Russell Duncan

I am trying to limit a combo box's options on a form based
on a earlier value entered on that form. I have the second
combo box operational without the SQL statement and with
the following SQL statement:

SELECT tbl_subcategories.categories,
tbl_subcategories.main_category FROM tbl_subcategories
WHERE(((tbl_subcategories.main_category)=value)) ORDER BY
tbl_subcategories.categories;

where in place of value I define a literal condition such
as "Cooperation/Coordination." However, I would like for
that WHERE clause to take the value from an earlier combo
box on the form and input it into the clause so that it
filters for the selected category. But when I write:

[frm_filing].[Combo14]

in place of value the form prompts for input (probably
because we cannot query a form's value). Equally, when I
write:

[tbl_filing].[main_category]

in place of value the form prompts for input (probably
because a specific record is not selected). This being the
case, how can I perform the task which I wish to
accomplish? i.e. how can I limit my Sub Categories to
those which are only applicable to the main category
selected.

Can anyone help?
 
If I understand you right, you are populating a combo box
(say, cbox2) using a query that reads a value from another
combo box (say, cbox1).

You can do this in the RowSource property of cbox2. Here's
an example:

SELECT table.col1, table.col2, etc FROM table WHERE
((table.col1=[CBox1]);

It should be that easy. If I misinterpreted your problem,
reply back and I (or somebody else) will help you out.

Gurtz
[email = no $]
 
Back
Top