How would I use a form that has 14 check boxes to query representatives that have the preferences specified by the check box. I created a query:
The problem with this is that it returns only representatives with exactly the configuration of check boxes that is on the form. I might just want to check one box and see anyone that meets that criteria regardless of the other check boxes. I'm new to all this and I can't quite figure it out.
Code:
SELECT tbl_CORPBONDPREF.AAA, tbl_CORPBONDPREF.[Investment Grade], tbl_CORPBONDPREF.[Less than Investment Grade], tbl_CORPBONDPREF.[1-5 Years], tbl_CORPBONDPREF.[5-10 Years], tbl_CORPBONDPREF.[10-20 Years], tbl_CORPBONDPREF.[20+ Years], tbl_CORPBONDPREF.[5], tbl_CORPBONDPREF.[10], tbl_CORPBONDPREF.[25], tbl_CORPBONDPREF.[25+], tbl_CORPBONDPREF.Discount, tbl_CORPBONDPREF.Par, tbl_CORPBONDPREF.Premium
FROM tbl_CORPBONDPREF
GROUP BY tbl_CORPBONDPREF.AAA, tbl_CORPBONDPREF.[Investment Grade], tbl_CORPBONDPREF.[Less than Investment Grade], tbl_CORPBONDPREF.[1-5 Years], tbl_CORPBONDPREF.[5-10 Years], tbl_CORPBONDPREF.[10-20 Years], tbl_CORPBONDPREF.[20+ Years], tbl_CORPBONDPREF.[5], tbl_CORPBONDPREF.[10], tbl_CORPBONDPREF.[25], tbl_CORPBONDPREF.[25+], tbl_CORPBONDPREF.Discount, tbl_CORPBONDPREF.Par, tbl_CORPBONDPREF.Premium
HAVING (((tbl_CORPBONDPREF.AAA)=[Forms]![frm_CORPPREFSEARCH]![AAA]) AND ((tbl_CORPBONDPREF.[Investment Grade])=[Forms]![frm_CORPPREFSEARCH]![Investment Grade]) AND ((tbl_CORPBONDPREF.[Less than Investment Grade])=[Forms]![frm_CORPPREFSEARCH]![Less than Investment Grade]) AND ((tbl_CORPBONDPREF.[1-5 Years])=[Forms]![frm_CORPPREFSEARCH]![1-5 Years]) AND ((tbl_CORPBONDPREF.[5-10 Years])=[Forms]![frm_CORPPREFSEARCH]![5-10 Years]) AND ((tbl_CORPBONDPREF.[10-20 Years])=[Forms]![frm_CORPPREFSEARCH]![10-20 Years]) AND ((tbl_CORPBONDPREF.[20+ Years])=[Forms]![frm_CORPPREFSEARCH]![20+ Years]) AND ((tbl_CORPBONDPREF.[5])=[Forms]![frm_CORPPREFSEARCH]![5]) AND ((tbl_CORPBONDPREF.[10])=[Forms]![frm_CORPPREFSEARCH]![10]) AND ((tbl_CORPBONDPREF.[25])=[Forms]![frm_CORPPREFSEARCH]![25]) AND ((tbl_CORPBONDPREF.[25+])=[Forms]![frm_CORPPREFSEARCH]![25+]) AND ((tbl_CORPBONDPREF.Discount)=[Forms]![frm_CORPPREFSEARCH]![Discount]) AND ((tbl_CORPBONDPREF.Par)=[Forms]![frm_CORPPREFSEARCH]![Par]) AND ((tbl_CORPBONDPREF.Premium)=[Forms]![frm_CORPPREFSEARCH]![Premium]));
The problem with this is that it returns only representatives with exactly the configuration of check boxes that is on the form. I might just want to check one box and see anyone that meets that criteria regardless of the other check boxes. I'm new to all this and I can't quite figure it out.