I have three combo boxes: cbo_prefRoom1, cbo_prefRoom2, cbo_prefRoom3.
On form initialisation cbo_prefRoom2 and cbo_prefRoom3 are disabled.
When the user selects an option in cbo_prefRoom1 then it enables cbo_prefRoom2.
When the user selects an option in cbo_prefRoom2 then it enables cbo_prefRoom3.
What I would like to do is add an instance in which if the user selects the option No Preference in cbo_prefRoom1 then what happens is cbo_prefRoom2 and cbo_prefRoom3 are updated with the same value of No Preference. Then cbo_prefRoom2 and cbo_prefRoom3 are disabled until the user changes the option of No Preference in cbo_prefRoom1.
There is also a second instance of this, if the user selects the option No Preference in cbo_prefRoom2 then cbo_prefRoom3 is updated with the same value of No Preference and disabled. Then cbo_prefRoom3 is disabled until the user changes the option of No Preference in cbo_prefRoom2.
How do I go about achieving this?
Private Sub cbo_prefRoom1_Change()
' When user selects an option in cbo_prefRoom1 then cbo_prefRoom2 is enabled
With cbo_prefRoom2
.Enabled = Len(cbo_prefRoom1.Value) > 0
If Not .Enabled Then
.ListIndex = -1
End If
End With
End Sub
Private Sub cbo_prefRoom2_Change()
' When user selects an option in cbo_prefRoom2 then cbo_prefRoom3 is enabled
With cbo_prefRoom3
.Enabled = Len(cbo_prefRoom2.Value) > 0
If Not .Enabled Then
.ListIndex = -1
End If
End With
End Sub
Something like this? You could also take the same idea and move it to the event for
cbo_prefRoom2click event.