Multiple Combo boxes and selections not repeated

kevers

Registered User.
Local time
Tomorrow, 04:50
Joined
Aug 13, 2012
Messages
18
Hi,

I have 2 combo boxes in my form that are related to the same query. This means that they have the same selections in the drop down.

Is it possible to have the drop down for the second combo box to update itself such that the selection made in combo box 1 does not appear?

Thanks a lot for your help.
 
Welcome to the forum.

What you are looking for is a variation of the Cascading Combo Box theme.

Hi,

I'm quite new to Access so I'm not sure if I understood the different examples correctly.
What I'm looking for is the following:

For example, I have a list of names in a table. Then, in the form, I have 2 combo boxes, both with the table as rowsource. When I choose Name A in the first combo box, can I do so that Name A does not appear in the drop down for combo box 2?

It sounds very trivial, but the examples that you linked me used a table with 2 columns whereas I only have 1.

Thanks again for your help.
 
Here's a quick sample to show you how it works.

Ok, I think I'm getting somewhere I just have a few more questions:

1) In the form, combo box 1 is linked to TBL_Items. In the row source, would it be the same if I just selected TBL_Items from the drop down or do I need to specifically type in the code? I also did not use an ItemID in my table, is that necessary?

2) combo box 2 is linked to the query. Again, do I need to type in the code in the row source or just select from the drop down?

3) I'm not really sure I understand what is being done in the query. Is it taking the selection from combo box 1 so that it is filtering the selections for combo box 2? Does this need to be in the ItemID field or can I use the Items field for the criteria?

4) If I have more than 2 combo boxes, do I just create more queries similar to QRY_Item2 but this time it would be QRY_Item3, QRY_Item4, etc. and then link each query to the corresponding combo box?

Again, really sorry if I made this simple matter even more confusing. Thanks a lot for your help.
 
Combo Box 1 can be set up using the Combo Box wizard just follow the bouncing ball.

For Combo Box two you will first need to create the query, and then once again just follow the bouncing ball of the Combo Box wizard.

The query is a select query that uses <> (not equal to) Combo Box 1 as it's criteria.

Now as an alternative to creating a query (I did this for clarity) you could simply create your second combo box following the Combo Box wizard and then once done, you could use the Ellipsis to edit the Row Source of the second combo and simply insert the criteria, as used in the query.

If you want more than one dependant Combo box all other combo boxes would need to exclude selections from previous Combo Boxes using an Or criteria. Thing would then start to become tricky as you would need to strictly control the order in which your user is able make selections in the subsequent combo boxes.
 
Could you take a look at what I did. I basically tried adding a third combo box. the query seems to work fine, excluding the first and second selections, but combo box 3 does not update accordingly. Am I not setting the row source properly?
 

Attachments

You will need to requery the third combo in the Following events, The Form's On Current, and the On Change of events of the first and second combos.

I've got to go out now, so have a play with that, and let me know how you get on. If your still having trouble, I make the adjustments to the sample and post back latter this evening.
 
Ok, I got it to work now.

Thanks a million!!
 

Users who are viewing this thread

Back
Top Bottom