nightflight
Registered User.
- Local time
- Today, 22:08
- Joined
- Mar 15, 2011
- Messages
- 24
I have a combo box with three options, "EA" "FAW" and "FAWR"
If "EA" is selected i want the query to return results where certtype="EA",
if "FAW" is selected i want the query to return results where certtype="FAW"
if "FAWR" is selected i want the query to return results where certtype="FAW" or "FAWR"
So what've I done wrong?
If "EA" is selected i want the query to return results where certtype="EA",
if "FAW" is selected i want the query to return results where certtype="FAW"
if "FAWR" is selected i want the query to return results where certtype="FAW" or "FAWR"
So what've I done wrong?
Code:
SELECT DISTINCTROW tbl_cert2.certname, tbl_cert2.certtype, tbl_cert2.certnum, tbl_cert2.certexpires
FROM tbl_people, tbl_cert2
GROUP BY tbl_cert2.certname, tbl_cert2.certtype, tbl_cert2.certnum, tbl_cert2.certexpires
HAVING (((tbl_cert2.certname)=Forms!frm_Person!cbo_Name) And ((tbl_cert2.certtype)=IIf(Forms!frm_Person!cbo_cert="FAWR",(tbl_cert2.certtype)="FAW" Or (tbl_cert2.certtype)="FAWR",Forms!frm_Person!cbo_cert)))
ORDER BY tbl_cert2.certexpires DESC;