1 combo box changes per 2 other combo boxes

  • Thread starter Thread starter PJLaux
  • Start date Start date
P

PJLaux

I have a form with 3 combo boxes. “Company”, “Tax ID”, and “Tax
Type”. The Tax Type is supposed to give options based on the criteria
that the user choses from the Tax ID and Tax Type combo boxes. I do
this by having a table with these 3 fields (the table name is
Tbl_A04_Co_TaxType_TaxID) and then a qry, “Qry_A07_DropDown_For_TaxID”
is in the Row Source for the Tax ID Combo. This qry has the following
sql code, SELECT Tbl_A04_Co_TaxType_TaxID.[Tax ID]
FROM Tbl_A04_Co_TaxType_TaxID
WHERE (((Tbl_A04_Co_TaxType_TaxID_.Company)=[Forms]![frm_Main]!
[txt_company]) AND ((Tbl_A04_Co_TaxType_TaxID_.[Tax Type])=[Forms]!
[frm_Main]![Combo_TaxType])); When I choose the criteria in the drop
downs for the Company and Tax Type combo boxes for the first time, I
will get the correct fields in the drop down for the Tax ID, but my
problem is that if I need to change the data in the tax type combo
box , my Tax ID drop-down will not change accordingly – it just keeps
the original data choices based on the original Tax Type that I
chose . I have put a macro in the After Update property of the Tax
Type Combo Box, which runs the Qry_A07_DropDown_For_TaxID and then
saves it with the reasoning that maybe this would fix the problem, but
it didn’t. Thanks for any help on this.
 
m:
I have a form with 3 combo boxes. “Company”, “Tax ID”, and “Tax
Type”. The Tax Type is supposed to give options based on the
criteria that the user choses from the Tax ID and Tax Type combo
boxes. I do this by having a table with these 3 fields (the table
name is Tbl_A04_Co_TaxType_TaxID) and then a qry,
“Qry_A07_DropDown_For_TaxID” is in the Row Source for the Tax ID
Combo. This qry has the following sql code, SELECT
Tbl_A04_Co_TaxType_TaxID.[Tax ID] FROM Tbl_A04_Co_TaxType_TaxID
WHERE (((Tbl_A04_Co_TaxType_TaxID_.Company)=[Forms]![frm_Main]!
[txt_company]) AND ((Tbl_A04_Co_TaxType_TaxID_.[Tax
Type])=[Forms]! [frm_Main]![Combo_TaxType])); When I choose the
criteria in the drop downs for the Company and Tax Type combo
boxes for the first time, I will get the correct fields in the
drop down for the Tax ID, but my problem is that if I need to
change the data in the tax type combo box , my Tax ID drop-down
will not change accordingly – it just keeps the original data
choices based on the original Tax Type that I chose . I have put
a macro in the After Update property of the Tax Type Combo Box,
which runs the Qry_A07_DropDown_For_TaxID and then saves it with
the reasoning that maybe this would fix the problem, but it
didn’t. Thanks for any help on this.


Running the query does not update the copy of the query that's in the
form, so you need to requery the combobox specifically.

Change the after_update event of your Tax Type combo box to
a macro that requeries the combobox, instead of the query itself
 
m:




I have a form with 3 combo boxes. “Company”, “Tax ID”, and “Tax
Type”.  The Tax Type is supposed to give options based on the
criteria that the user choses from the Tax ID and Tax Type combo
boxes.  I do this by having a table with these 3 fields (the table
name is Tbl_A04_Co_TaxType_TaxID) and then a qry,
“Qry_A07_DropDown_For_TaxID” is in the Row Source for the Tax ID
Combo.  This qry has the following sql code, SELECT
Tbl_A04_Co_TaxType_TaxID.[Tax ID] FROM Tbl_A04_Co_TaxType_TaxID
WHERE (((Tbl_A04_Co_TaxType_TaxID_.Company)=[Forms]![frm_Main]!
[txt_company]) AND ((Tbl_A04_Co_TaxType_TaxID_.[Tax
Type])=[Forms]! [frm_Main]![Combo_TaxType]));  When I choose the
criteria in the drop downs for the Company and Tax Type combo
boxes for the first time, I will get the correct fields in the
drop down for the Tax ID, but my problem is that if I need to
change the data in the tax type combo box , my Tax ID drop-down
will not change accordingly – it just keeps the original data
choices based on the original Tax Type that I chose .  I have put
a macro in the After Update property of the Tax Type Combo Box,
which runs the Qry_A07_DropDown_For_TaxID and then saves it with
the reasoning that maybe this would fix the problem, but it
didn’t.  Thanks for any help on this.

Running the query does not update the copy of the query that's in the
form, so you need to requery the combobox specifically.

Change the after_update event of your Tax Type combo box to
a macro that requeries the combobox, instead of the query itself- Hide quoted text -

- Show quoted text -

Thanks for your reply. How do you requery a combobox?
 
m:
I have a form with 3 combo boxes. “Company”, “Tax ID”, and “Tax
Type”.  The Tax Type is supposed to give options based on the
criteria that the user choses from the Tax ID and Tax Type combo
boxes.  I do this by having a table with these 3 fields (the table
name is Tbl_A04_Co_TaxType_TaxID) and then a qry,
“Qry_A07_DropDown_For_TaxID” is in the Row Source for the Tax ID
Combo.  This qry has the following sql code, SELECT
Tbl_A04_Co_TaxType_TaxID.[Tax ID] FROM Tbl_A04_Co_TaxType_TaxID
WHERE (((Tbl_A04_Co_TaxType_TaxID_.Company)=[Forms]![frm_Main]!
[txt_company]) AND ((Tbl_A04_Co_TaxType_TaxID_.[Tax
Type])=[Forms]! [frm_Main]![Combo_TaxType]));  When I choose the
criteria in the drop downs for the Company and Tax Type combo
boxes for the first time, I will get the correct fields in the
drop down for the Tax ID, but my problem is that if I need to
change the data in the tax type combo box , my Tax ID drop-down
will not change accordingly – it just keeps the original data
choices based on the original Tax Type that I chose .  I have put
a macro in the After Update property of the Tax Type Combo Box,
which runs the Qry_A07_DropDown_For_TaxID and then saves it with
the reasoning that maybe this would fix the problem, but it
didn’t.  Thanks for any help on this.
Running the query does not update the copy of the query that's in the
form, so you need to requery the combobox specifically.
Change the after_update event of your Tax Type combo box to
a macro that requeries the combobox, instead of the query itself- Hide quoted text -
- Show quoted text -

Thanks for your reply.  How do you requery a combobox?- Hide quoted text -

- Show quoted text -

Nevermind - I figured it out. Thanks.
 
Back
Top