Cascading Combo Boxes?

andchea

New member
Local time
Today, 06:38
Joined
Jun 25, 2009
Messages
2
I have been looking around to figure this out, but haven't found anything that works yet.

I have a form based on a table - Workflow. I have two combo boxes that look at two other tables for their values. Combo2 uses table Contract_Type to pick a contract_type. Combo4 uses table Contract_Name to pick a contract_name that is tied to a contract type.

I want to the user to be able to pick "Medicare" or "Commercial" from the Contract_Type combo box and then, based on what they select, filter the Contract_Name(s) so that the drop-down only shows names tied to that contract_type.

I think it's just a matter of modifying my Row Source, but I can't figure out the correct code to use.

Any help is greatly appreciated
 
Take a look at the attached demo file. Specifically look at the record source of the second combo box. This should give you a clue as to how to set up your second combo box. Also look at the After Update event of the first combo box.
 
Last edited:
well, first of all, the two tables that you mentioned here must have a common primary key so that you can establish the relationship between the two tables.

next, it's either on the lostfocus of the first combobox or the gotfocus of the second combobox, requery the second combobox. you second combobox must have the row source of your contract_name. it is important that your rowsource must have two columns because the first column would be what will appear on the combobox but the second column is what will be saved in your source table. and after that on the criteria in the query design view of your rowsource, you must place "forms!formname!comboxbox2!

then set your bound column to 2. try it.
 
Thank you so much! I got it to work with help from all of you.

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom