Hi
I'm having troubles with this query. Everything works fine with the option group selecting the right records from the table. However, I get the error "..expression too complex to be evaluated" when I include the criteria after the final AND. This criteria checks to see if the first selection from the combo box was chosen, if true then have nothing in the criteria. If false, then select all records for the Relevant_Leader.
Any help would be appreciated, thanks!
SELECT M_HASIFDB.Relevant_Leader, M_HASIFDB.Date_Reported, M_HASIFDB.Originator, M_HASIFDB.Description, M_HASIFDB.Originator_Action, M_HASIFDB.Date_Entered, M_HASIFDB.Category, M_HASIFDB.Leader_Urgency, M_HASIFDB.Leader_Action, M_HASIFDB.Target_Date, M_HASIFDB.Date_Completed, M_HASIFDB.MRC_Reviewed, M_HASIFDB.Date_Reviewed, M_HASIFDB.HASIF_ID
FROM M_HASIFDB
WHERE (((IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=1,([M_HASIFDB].[Date_Completed]) Is Null,IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=2,([M_HASIFDB].[Date_Completed]) Is Not Null,IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=3,([M_HASIFDB].[MRC_Reviewed])=False,([M_HASIFDB].[Date_Entered]) Between [Forms]![F_ReportsMenu]![FromDate] And [Forms]![F_ReportsMenu]![ToDate]))))<>False) AND (([Forms]![F_ReportsMenu]![LeaderCbo_GenericReport])=IIf([Forms]![F_ReportsMenu]![LeaderCbo_GenericReport]=0,0,[Relevant_Leader])));
I'm having troubles with this query. Everything works fine with the option group selecting the right records from the table. However, I get the error "..expression too complex to be evaluated" when I include the criteria after the final AND. This criteria checks to see if the first selection from the combo box was chosen, if true then have nothing in the criteria. If false, then select all records for the Relevant_Leader.
Any help would be appreciated, thanks!
SELECT M_HASIFDB.Relevant_Leader, M_HASIFDB.Date_Reported, M_HASIFDB.Originator, M_HASIFDB.Description, M_HASIFDB.Originator_Action, M_HASIFDB.Date_Entered, M_HASIFDB.Category, M_HASIFDB.Leader_Urgency, M_HASIFDB.Leader_Action, M_HASIFDB.Target_Date, M_HASIFDB.Date_Completed, M_HASIFDB.MRC_Reviewed, M_HASIFDB.Date_Reviewed, M_HASIFDB.HASIF_ID
FROM M_HASIFDB
WHERE (((IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=1,([M_HASIFDB].[Date_Completed]) Is Null,IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=2,([M_HASIFDB].[Date_Completed]) Is Not Null,IIf([Forms]![F_ReportsMenu]![Filter_Op_Group]=3,([M_HASIFDB].[MRC_Reviewed])=False,([M_HASIFDB].[Date_Entered]) Between [Forms]![F_ReportsMenu]![FromDate] And [Forms]![F_ReportsMenu]![ToDate]))))<>False) AND (([Forms]![F_ReportsMenu]![LeaderCbo_GenericReport])=IIf([Forms]![F_ReportsMenu]![LeaderCbo_GenericReport]=0,0,[Relevant_Leader])));