S
sharon.brubaker
Guest
I have a list box that uses the following code to open a filtered form based on the item selected:
_______________________________________
Private Sub Command5_Click()
Dim DivFilter As String
Dim frm As Form
Dim ctl As Control
Dim varItm As Variant
Set frm = Forms!frmDivisionPopup
Set ctl = frm!List0
For Each varItm In ctl.ItemsSelected
strDivision = ctl.ItemData(varItm)
Next varItm
DivFilter = "org = '" & strDivision & "'"
DoCmd.Close acForm, "frmDivisionPopup", acSaveNo
Select Case strOpenForm
Case "BaseBudget"
DoCmd.OpenForm "frm01inputdetailtest", , "qryBudgetInputCosts", DivFilter
Case "Carryover"
DoCmd.OpenForm "frmCarryoverInput", , "qryCarryoverrequestinput", DivFilter
Case "Supps"
DoCmd.OpenForm "frmSupplementalInput", , "qrysupprequestinput", DivFilter
End Select
End Sub
_______________________________________
I have been asked to change this from a list box to a combo box…
Does anyone know how to pass the selected value from the combo box on to the filter?
I have spent the entire day trying different variations of the above code with no luck.
_______________________________________
Private Sub Command5_Click()
Dim DivFilter As String
Dim frm As Form
Dim ctl As Control
Dim varItm As Variant
Set frm = Forms!frmDivisionPopup
Set ctl = frm!List0
For Each varItm In ctl.ItemsSelected
strDivision = ctl.ItemData(varItm)
Next varItm
DivFilter = "org = '" & strDivision & "'"
DoCmd.Close acForm, "frmDivisionPopup", acSaveNo
Select Case strOpenForm
Case "BaseBudget"
DoCmd.OpenForm "frm01inputdetailtest", , "qryBudgetInputCosts", DivFilter
Case "Carryover"
DoCmd.OpenForm "frmCarryoverInput", , "qryCarryoverrequestinput", DivFilter
Case "Supps"
DoCmd.OpenForm "frmSupplementalInput", , "qrysupprequestinput", DivFilter
End Select
End Sub
_______________________________________
I have been asked to change this from a list box to a combo box…
Does anyone know how to pass the selected value from the combo box on to the filter?
I have spent the entire day trying different variations of the above code with no luck.