Limiting values in a dropdown field by a different dropdown field

eshai

Registered User.
Local time
Today, 22:50
Joined
Jul 14, 2015
Messages
195
i have a table todo list in my table there are 2 dropdown fields one called main Categories and the second called sub Categories now i want to restrict the sub Categories by the main Categories example if i choose in the main Categories finance it well restrict the sub Categories to the value that related to (Loans, salaries, etc.) 1. can i do it on a query with "DLookUp" if yes how? 2. i know it can be done in form afterupdate. how? pls i need a A detailed explanation Thanks in advance
 
in your subcategories combo rowsource put something like

Code:
SELECT ID, subCategoryName
FROM tblsubCategories
WHERE CategoryD=[MainCategories] OR [MainCategories] is null

in your maincategories combo after update event put

Code:
 me.subcategories.requery
 
in your subcategories combo rowsource put something like

Code:
SELECT ID, subCategoryName
FROM tblsubCategories
WHERE CategoryD=[MainCategories] OR [MainCategories] is null

in your maincategories combo after update event put

Code:
 me.subcategories.requery

not working or i did something wrong
i get error "You have written a subquery that can return more than one field without using the EXISTS reserved word in the main query's FROM clause. Revise the SELECT statement of the subquery to request only one field. (Error 3306)"
 
I did not provide subquery - so looks like it is something else
 

Users who are viewing this thread

Back
Top Bottom