General discussion

  • Creator
    Topic
  • #2130747

    drop down list creation

    Locked

    by arrowe ·

    When a drop down list of ten products has been created using Data Validation, how do you cause the choice of just ONE of the products to open up another drop down list in the next cell on the row?

All Comments

  • Author
    Replies
    • #3569442

      drop down list creation

      by matthew.alverson ·

      In reply to drop down list creation

      Depends on your development enviroment. But most would be able to apply a filter to the second drop down from within the change event of the first drop down

      Private Sub Combo1_Changed()
      ‘Apply filter to data source for combo2
      end sub

    • #3568309

      drop down list creation

      by bob sellman ·

      In reply to drop down list creation

      You don’t say what you’re doing this in, so I’ll use Access (which also works for VB) as an example. Other languages should have similar capabilities.

      There are a few steps to follow.

      First, the next column or cell in the row should use a query as it’s data source that is based on the first drop down list (call the first list cboFirst and the second cboSecond). So the data source for cboSecond would be something like:

      SELECT secondColumn FROM [tablename] WHERE [FirstColumn] = me.cboFirst

      If you’re doing this in Access (VBA) or VB and the first drop down choice is text, surround me.cboFirst with single quotes (if a date, surround it with #).

      The next important step is that you need a property on cboFirst that forces cboSecond to be requeried (or recalculated) when cboFirst is updated. Otherwise, the list for cboSecond will always be based on the first list created when you opened the form and made the first entry in cboFirst.

    • #3660035

      drop down list creation

      by arrowe ·

      In reply to drop down list creation

      This question was auto closed due to inactivity

Viewing 2 reply threads