How can I enable/disable items within a drop-down list box depending on what has been selected in a second drop-down list box?
Thanks,
Printable View
How can I enable/disable items within a drop-down list box depending on what has been selected in a second drop-down list box?
Thanks,
There may or may not be a way to actually disable specific items using the APIs, but you can simulate it by setting the ItemData of the rows you want to disable to 1 (or some other non-zero value) and then put this code in the list's click event
Code:If List1.ListIndex = -1 Then Exit Sub
If List1.ItemData(List1.ListIndex) = 1 Then
List1.Selected(List1.ListIndex) = False
MsgBox "disabled"
End If