G
Guest
With the code below I'm trying to use a combo box (on main Form to filter
another combo box on a sub form. cboOPmedsClass is the first combo box and it
has re: 10 major drug classification in it, i.e., "Cardiovascular". Based on
the choice made in this combo I want the choices in the second combo box to
be limited to the drugs that are in the chosen class.
I've tried to accomplish this by creating the variable sDrugClass assigning
its value to what ever is in the first combo box and then using it to filter
the query that populates the items on the second combo box's list.
Of course it doesn't work. Any help would be greatly appreciated.
Thanks,
Rob
************************************************************
Private Sub cboOPmedsClass_AfterUpdate()
Dim sDrugClass As String
sDrugClass = Me.cboOPmedsClass.Text
Me!fsubOPmeds.Form!cboOPmedsLU.RowSource = "SELECT * FROM tblOPmedsLU " & _
"WHERE tblOPmedsLU.fldClassification = sDrugClass " & "ORDER BY
tblOPmedsLU.fldBRAND_NAME"
Me!fsubOPmeds.Form!cboOPmedsLU.Requery
End Sub
another combo box on a sub form. cboOPmedsClass is the first combo box and it
has re: 10 major drug classification in it, i.e., "Cardiovascular". Based on
the choice made in this combo I want the choices in the second combo box to
be limited to the drugs that are in the chosen class.
I've tried to accomplish this by creating the variable sDrugClass assigning
its value to what ever is in the first combo box and then using it to filter
the query that populates the items on the second combo box's list.
Of course it doesn't work. Any help would be greatly appreciated.
Thanks,
Rob
************************************************************
Private Sub cboOPmedsClass_AfterUpdate()
Dim sDrugClass As String
sDrugClass = Me.cboOPmedsClass.Text
Me!fsubOPmeds.Form!cboOPmedsLU.RowSource = "SELECT * FROM tblOPmedsLU " & _
"WHERE tblOPmedsLU.fldClassification = sDrugClass " & "ORDER BY
tblOPmedsLU.fldBRAND_NAME"
Me!fsubOPmeds.Form!cboOPmedsLU.Requery
End Sub