Hi, all.
I have a form with a comboBox on it. It has two choices. When I choose one I need it to run a particular macro. The macros do not launch as is. What is wrong with my code?
Private Sub Combo42_OnChange(Cancel As Integer)
If Combo42.SelText = "Cost Center Sort" Then
DoCmd.RunMacro (CostCenterSort)
ElseIf Combo42.SelText = "Cost Center Filter" Then
DoCmd.RunMacro (CostCenterQuery)
End If
End Sub
I set it up as unbound with "Cost Center Sort" and "Cost Center Filter" as the choices.
Thanks everyone.
PB
I have a form with a comboBox on it. It has two choices. When I choose one I need it to run a particular macro. The macros do not launch as is. What is wrong with my code?
Private Sub Combo42_OnChange(Cancel As Integer)
If Combo42.SelText = "Cost Center Sort" Then
DoCmd.RunMacro (CostCenterSort)
ElseIf Combo42.SelText = "Cost Center Filter" Then
DoCmd.RunMacro (CostCenterQuery)
End If
End Sub
I set it up as unbound with "Cost Center Sort" and "Cost Center Filter" as the choices.
Thanks everyone.
PB