I have a search form with 2 combo boxes, the second combo box is a nested combo box of the first. In the top combo the user selects fruit, meat, or pastry. In the second combo box the user would select types of fruit or meat etc.
I have a search button that changes the record source of the query depending on if anything was entered in the second combo box. The results will return suppliers of fruit for example but if something was entered in the second combo box it will return suppliers of specific fruit.
I am currently doing this with two queries but I want to do it with just one query.
I have set the criteria for the second combo box as follows but it doesn’t seem to be working.
So effectively, if there is something in the second drop down box I want the query to use it or if it is empty I want the query to ignore it as though there was nothing in there.
I have a search button that changes the record source of the query depending on if anything was entered in the second combo box. The results will return suppliers of fruit for example but if something was entered in the second combo box it will return suppliers of specific fruit.
I am currently doing this with two queries but I want to do it with just one query.
I have set the criteria for the second combo box as follows but it doesn’t seem to be working.
Code:
IIf(IsNull([Forms]![frm_Product_Supplier_Search]![cbo_Category3]),Null,[Forms]![frm_Product_Supplier_Search]![cbo_Category3])
So effectively, if there is something in the second drop down box I want the query to use it or if it is empty I want the query to ignore it as though there was nothing in there.