Below is the code that I have on a comboBox AfterUpdate
Event. It runs a query and uses the value of Distinct
Behavior for the criteria. The Distinct Behaviors dropdown
is based on what is slected from a Dropdown from a Distinct
Categories ComboBox. What I would like is to run a specific
Query based on what is selected from the Distinct Behaviors
ComboBox. Any advice?
Event. It runs a query and uses the value of Distinct
Behavior for the criteria. The Distinct Behaviors dropdown
is based on what is slected from a Dropdown from a Distinct
Categories ComboBox. What I would like is to run a specific
Query based on what is selected from the Distinct Behaviors
ComboBox. Any advice?
Code:
Private Sub DistinctCategories_AfterUpdate()
On Error Resume Next
DistinctBehaviors.RowSource = "SELECT DISTINCT ObserversSecondTbl.Behaviors " & _
"FROM ObserversSecondTbl " & _
"WHERE ObserversSecondTbl.Categories = '" & DistinctCategories.Value & "' " & _
"ORDER BY ObserversSecondTbl.Behaviors;"