Filtered combo or list box problems

G

Guest

Hello all,

I am having a problem with one of my combo boxes. I have a list of software
titles with individual subcomponents attached to each. For instance:

Software A, comp1
Software A, comp2
Software B, mod1
Software B, mod2

In a form & table, I have it set so I can select the Software A in on field
and then select the subcomponent in the second field. However, I see all of
the components (comp1, comp2, mod1, mod2) not just the ones tied to that
specific software. This is leading to invalid data. How can I fix this from
happening?

Thanks for your help!
 
G

Guest

Correlate the second combo box with the first by giving it a RowSource
property such as:

SELECT Component
FROM Components
WHERE Software = Form!cboSoftware
ORDER BY Component;

In cboSoftware's AfterUpdate event procedure requery the second combo box:

Me.cboComponents.Requery

This will only work in single form view, however, not in continuous form
view. To do it in the latter you need to use a hybrid control made up of a
text box over a combo box so it looks like one control.

BTW the fact that you can have invalid data points to a design flaw in your
table. You should in fact have a column only for the components, not for the
software as this is determined by the component value and is thus redundant
in the table. You can show the Software on a form or report in an unbound
computed control or via a query which joins the tables.
 

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

Similar Threads


Top