Hi everyone,
I'm new to access and was wondering if anyone could help with the standard 'enter parameter value' prompt that catches all newbies out.
Basically, I have a form that has two combo boxes (combo1 & combo2) in a form "Client_database". The record sources for each of these combo boxes are primary keys derived from two different tables (Company_details and Product_details). These values are then referenced in separate fields in a query to filter another table (Client_information). This query has been inserted as a sub form into "Client_database" as a datasheet.
The SQL is coded such that when the combo boxes are empty, the query doesn't filter out any of the results. For some reason access has started prompting me for parameter values when I open either the form, query or subform. I have checked the references and they are correct. If I enter the values then the query works fine. Why is it prompting me?? The SQL where condition is below:*
WHERE
((( [Forms]![Client_database]![Combo1]) Is Null) AND ( ( [Forms]![Client_database]![Combo2]) Is Null))
OR
(((Company_details.company_id)=[Forms]![Client_database]![Combo1]) AND (([Forms]![Client_database]![Combo1]) Is Not Null) AND (([Forms]![Client_database]![Combo2]) Is Null))
OR
(((Product_details.product_id)=[Forms]![Client_database]![Combo2]) AND (([Forms]![Client_database]![Combo1]) Is Null) AND (([Forms]![Client_database]![Combo2]) Is Not Null))
OR
(((Company_details.company_id)=[Forms]![Client_database]![Combo1]) AND ((Product_details.product_id)=[Forms]![Client_database]![Combo2]) AND (([Forms]![Client_database]![Combo1]) Is Not Null) AND (([Forms]![Client_database]![Combo2]) Is Not Null));
I'm new to access and was wondering if anyone could help with the standard 'enter parameter value' prompt that catches all newbies out.
Basically, I have a form that has two combo boxes (combo1 & combo2) in a form "Client_database". The record sources for each of these combo boxes are primary keys derived from two different tables (Company_details and Product_details). These values are then referenced in separate fields in a query to filter another table (Client_information). This query has been inserted as a sub form into "Client_database" as a datasheet.
The SQL is coded such that when the combo boxes are empty, the query doesn't filter out any of the results. For some reason access has started prompting me for parameter values when I open either the form, query or subform. I have checked the references and they are correct. If I enter the values then the query works fine. Why is it prompting me?? The SQL where condition is below:*
WHERE
((( [Forms]![Client_database]![Combo1]) Is Null) AND ( ( [Forms]![Client_database]![Combo2]) Is Null))
OR
(((Company_details.company_id)=[Forms]![Client_database]![Combo1]) AND (([Forms]![Client_database]![Combo1]) Is Not Null) AND (([Forms]![Client_database]![Combo2]) Is Null))
OR
(((Product_details.product_id)=[Forms]![Client_database]![Combo2]) AND (([Forms]![Client_database]![Combo1]) Is Null) AND (([Forms]![Client_database]![Combo2]) Is Not Null))
OR
(((Company_details.company_id)=[Forms]![Client_database]![Combo1]) AND ((Product_details.product_id)=[Forms]![Client_database]![Combo2]) AND (([Forms]![Client_database]![Combo1]) Is Not Null) AND (([Forms]![Client_database]![Combo2]) Is Not Null));