still quite new to VBA code so dont know if this is possible.
I have a combo box i use to filter a form using the after update action. What i want to do is to also use this to set the record source for another combo box as well. I can make the code run indiviudally, but can only run one or the other. What i want to do is combine them into one private sub so that when i update the combo box it filters the form and sets the record source for the next combo box.
Codes i currently have are
Filter Form:
Private Sub Combo12_AfterUpdate()
Me.Filter = "[ServiceUnit] = " & "'" & [Combo12].Column(0) & "'"
Me.FilterOn = True
End Sub
Set RecordSource for Combo box
Private Sub Combo12_AfterUpdate()
Combo12.RowSource = "Select TblSU.JERef " & _
"FROM TblSU " & _
"WHERE TblSU.ExGroup = '" & Combo14.Value & "' " & _
"ORDER BY TblSU.ServiceUnit;"
Any help wold be appreciated.
I have a combo box i use to filter a form using the after update action. What i want to do is to also use this to set the record source for another combo box as well. I can make the code run indiviudally, but can only run one or the other. What i want to do is combine them into one private sub so that when i update the combo box it filters the form and sets the record source for the next combo box.
Codes i currently have are
Filter Form:
Private Sub Combo12_AfterUpdate()
Me.Filter = "[ServiceUnit] = " & "'" & [Combo12].Column(0) & "'"
Me.FilterOn = True
End Sub
Set RecordSource for Combo box
Private Sub Combo12_AfterUpdate()
Combo12.RowSource = "Select TblSU.JERef " & _
"FROM TblSU " & _
"WHERE TblSU.ExGroup = '" & Combo14.Value & "' " & _
"ORDER BY TblSU.ServiceUnit;"
Any help wold be appreciated.