5 replies
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
by arrowe
by bob sellman
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.
by arrowe
by arrowe
This discussion is closed to new replies.
Trending Software posts
Sort by Trending