0
votes

I have a ComboBox which will display data which dependent on what has been entered in another ComboBox. The second ComboBox is not updating (showing) data in the dropdown after the first has been updated...

Company_Select_Combo is the first ComboBox. After a selection has been made in this combobox, Marketer_Select_Combo becomes visible on the form, and this query should reflect those marketers associated to the company selected in the first combo...

Help

Private Sub Company_Select_Combo_AfterUpdate()

If Company_Select_Combo > 0 Then


    Company_Select_Combo.Enabled = False
    Marketer_Select_Combo.Visible = True
    Me.Marketer_Select_Combo.Requery


Else

    Marketer_Select_Combo.Enabled = False

End If

End Sub

1
Edit question to show the Marketer combobox RowSource SQL. What if user needs to edit the Marketer on an existing record without changing the Company?June7
The Company must be selected first because there are different marketers associated with each company. Once the company is selected, the company combo/field is disabled and the marketer combo/field is enabled.CPM

1 Answers

0
votes

Let assume your "Marketer_Select_Combo" query includes: Marketer_ID, Marketer_Name, and Company_ID

Then simply add the following statement to your SQL:

WHERE Company_ID = [Forms]![yourformname]![Company_Select_Combo]

This way, the elements should be limited to the chosen company. By calling the Requery/Recalc method as you did, it should work as intended.