Automatic Update combo box Rowsource RRS feed

  • Question

  • My problem is a Form has 30 Combo box for a selection of  teams of 2 up to 15 max.

    Each year the selection changes as their could be 10 items one year the following could be 26 items.

    The forms On Open event I wish to automatically by using a SQL code to insert into the rowsource of the combo box to return the relevant information for that year

    My combo boxes are identified as cmbOject1 through to cmbOject30. I have a control object Team(30) and each combo box is set to the relevant control item.  Set team(1) = cmbOject1 etc

    A variable = SQL code 

    An iteration could 

    for I = 1 to 30

         team(I).rowsource = variable  Gives an Error

         next i

    Saturday, April 2, 2016 6:45 AM


  • Hi. Looping may not be necessary. If the source of the data is in a table, then you might be able to just add a criteria to the SQL of the combobox to always display the correct values.
    Saturday, April 2, 2016 3:57 PM