fill combo based on values other combo's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pierkes
    New Member
    • Feb 2013
    • 64

    fill combo based on values other combo's

    Hi,

    I have 10 combo boxes called

    cbo_wens1 to cbo_wens10
    The Rowsource for all the combo's is the same;

    Code:
    SELECT Q_wensen.ID_wens, Q_wensen.variabele FROM Q_wensen
    ;

    However if a item in cbo_wens1 is selected, the list of possibilities in the other nine comboboxes must be without the selected item in cbo_wens1.

    When the user selects the dropdown of combox cbo_wens2, the user shouls only see items that have not been selected in one of the other comboboxes.

    Any help is really appreciated !
    Regards,
    Pierkes
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    There are many threads on this forum which discuss this same exact issue (although not with multiple Combo Boxes). Please see those for basics.

    The solution is to simply add VBA to the AfterUpdate event of the Combo box which creates the row source for the following combo box. Then assign thaat SQL string to the combo box, requery it and wait for the next action.

    I would also disable combo boxes 2-10, and include code in the same event to enable the next combo box.

    This is relatively "simple" but complex, because you have to keep adding the values of each combo box in your next row source. But, it can be done.

    Comment

    Working...