View Full Version : Filter one column based on another


dgthompson
02-14-2002, 03:21 AM
I posted this in the Queries forum too, I apologize - I didn't realize I wasn't in the Forms area...........

I have three tables:
Categories
SubCategories
Products
In the Categories table I have say the following values "cat1", "cat2", "cat3"

In the SubCategories table I have two columns "SubCategory" and "UnderTopCategory" where the "UnderTopCategory" column is linked to the Categories table. So I have values like "subcat1,cat1", "subcat2,cat1", "subcat3,cat2"....

Now in my Products table I have columns "ProductID", "TopCategroy"(which is linked to the Categories table), "SubCategory"(which is linked to the SubCategories table.

QUESTION: I want to be able to limit the values that can be chosen in the "SubCategory" column of my Products table to only those "SubCategory" values who have the same "UnderTopCategory" value (from SubCategories table) as the value entere in "TopCategory" (from the Products table).

EXAMPLE: So if the user is in the Products table entering products, and puts in:
"ProductID"=123
"TopCategory"=cat1
I want the drop down list box of the "SubCategory" columns to only show "subcat1" and "subcat2" (since those are the only ones whose "UnderTopCategory" equals the "TopCategory" the user chose.

I hope I didn't totally confuse anyone...

Thanks for the help

David R
02-14-2002, 07:52 AM
Did you try the answer Jack Cowley gave you in the Queries forum? In addition, try looking up 'cascad combo box' in the archives, I believe that is what you're trying to do here.

HTH,
David R