General discussion

Locked

drop down list creation

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?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

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

Collapse -

drop down list creation

by arrowe In reply to drop down list creation

The question was auto-closed by TechRepublic

Collapse -

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.

Collapse -

drop down list creation

by arrowe In reply to drop down list creation

The question was auto-closed by TechRepublic

Collapse -

drop down list creation

by arrowe In reply to drop down list creation

This question was auto closed due to inactivity

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums