SELECT Reports.*, FunctionalAreas.FunctionalArea, FunctionalAreas.Abbrev
FROM FunctionalAreas INNER JOIN Reports ON FunctionalAreas.FunctionalAreaID = Reports.FunctionalAreaID
WHERE (((Reports.FunctionalAreaSub1) Like nz([Forms]![frmReports]![cboFilter_FunctionalAreaSub1],"*")) AND ((Reports.FunctionalAreaSub2) Like nz([Forms]![frmReports]![cboFilter_FunctionalAreaSub2],"*")) AND ((Reports.ReportID) In (SELECT DISTINCT ReportID FROM Reports WHERE (( Reports.ReportID Like nz([Forms]![frmReports]![cboFilter_ReportID_Only],"*")) )) And ((Reports.ReportID) In (SELECT DISTINCT ReportID FROM Reports WHERE (( Reports.Title like ("*" & nz([Forms]![frmReports]![txtSearch],"") & "*") )) ) Or (Reports.ReportID) In (SELECT DISTINCT ReportID FROM Reports WHERE ((Reports.FunctionalAreaSub1 like ("*" & nz([Forms]![frmReports]![txtSearch],"") & "*") )) ) Or (Reports.ReportID) In (SELECT DISTINCT ReportID FROM Reports WHERE ((Reports.FunctionalAreaSub2 like ("*" & nz([Forms]![frmReports]![txtSearch],"") & "*") )) ) Or (Reports.ReportID) In (SELECT DISTINCT ReportID FROM Reports WHERE ((FunctionalAreas.Abbrev like ("*" & nz([Forms]![frmReports]![txtSearch],"") & "*")))))) AND ((Reports.FunctionalAreaID) Like nz([Forms]![frmReports]![cboFilter_FunctionalAreaID],"*")))
ORDER BY FunctionalAreas.FunctionalArea, FunctionalAreas.Abbrev, Reports.FunctionalAreaSub1, Reports.FunctionalAreaSub2;
|