I am trying to run a recordsed to get data from a qry with multiple criteria. When I open the report I get an error '3061' to few paramiters: expected 6
Any Ideas?
Report VB:
Set Cdb = CurrentDb
Set rsJobs = Cdb.OpenRecordset("Select Count([Kit_Type])as Jobs From qryQAFilterTA WHERE Kit_Type = " & Chr(34) & Me![Kit_Type] & Chr(34))
bJobCount2 = Nz(rsJobs!Jobs)
Me.Text26 = bJobCount2
rsJobs.Close
Set rsJobs = Nothing
Set Cdb = Nothing
Qry SQL:
SELECT QA.local_id, QA.Kit_Type, QA.InspectedBy, QA.QADate, QA.Discrepency, QA.Inspector, QA.QAUser, QA.QADateAuto, QA.[Repair date], QA.RepairDisc, QA.RepairUser, QA.RepairDateAuto, QA.Init, QA.Closed, QA.DiscrepancyType, QA.OutsideAgency, QA.Remarks, QA.User, QA.DateCleared, QA.ext1, QA.ext2, QA.ext3, QA.ext4
FROM QA
WHERE (((QA.local_id)=IIf([Forms]![frmQAMain]![txtID].[Value] Is Null Or [Forms]![frmQAMain]![txtID].[Value]="",[local_id],[Forms]![frmQAMain]![txtID].[Value])) AND ((QA.Kit_Type)=IIf([Forms]![frmQAMain]![txtEquipType].[Value] Is Null Or [Forms]![frmQAMain]![txtEquipType].[Value]="",[Kit_Type],[Forms]![frmQAMain]![txtEquipType].[Value])) AND ((QA.InspectedBy)=IIf([Forms]![frmQAMain]![txtInsp].[Value] Is Null Or [Forms]![frmQAMain]![txtInsp].[Value]="",[InspectedBy],[Forms]![frmQAMain]![txtInsp].[Value])) AND ((QA.Inspector)=IIf([Forms]![frmQAMain]![txtQA].[Value] Is Null Or [Forms]![frmQAMain]![txtQA].[Value]="",[Inspector],[Forms]![frmQAMain]![txtQA].[Value])) AND ((QA.Closed)=IIf([Forms]![frmQAMain]![frmStatus].[value]=1,-1,IIf([Forms]![frmQAMain]![frmStatus].[value]=2,0,[closed]))) AND ((QA.OutsideAgency)=IIf([Forms]![frmQAMain]![frmInspBy].[value]=1,-1,IIf([Forms]![frmQAMain]![frmInspBy].[value]=2,0,[OutsideAgency]))));
Any Ideas?
Report VB:
Set Cdb = CurrentDb
Set rsJobs = Cdb.OpenRecordset("Select Count([Kit_Type])as Jobs From qryQAFilterTA WHERE Kit_Type = " & Chr(34) & Me![Kit_Type] & Chr(34))
bJobCount2 = Nz(rsJobs!Jobs)
Me.Text26 = bJobCount2
rsJobs.Close
Set rsJobs = Nothing
Set Cdb = Nothing
Qry SQL:
SELECT QA.local_id, QA.Kit_Type, QA.InspectedBy, QA.QADate, QA.Discrepency, QA.Inspector, QA.QAUser, QA.QADateAuto, QA.[Repair date], QA.RepairDisc, QA.RepairUser, QA.RepairDateAuto, QA.Init, QA.Closed, QA.DiscrepancyType, QA.OutsideAgency, QA.Remarks, QA.User, QA.DateCleared, QA.ext1, QA.ext2, QA.ext3, QA.ext4
FROM QA
WHERE (((QA.local_id)=IIf([Forms]![frmQAMain]![txtID].[Value] Is Null Or [Forms]![frmQAMain]![txtID].[Value]="",[local_id],[Forms]![frmQAMain]![txtID].[Value])) AND ((QA.Kit_Type)=IIf([Forms]![frmQAMain]![txtEquipType].[Value] Is Null Or [Forms]![frmQAMain]![txtEquipType].[Value]="",[Kit_Type],[Forms]![frmQAMain]![txtEquipType].[Value])) AND ((QA.InspectedBy)=IIf([Forms]![frmQAMain]![txtInsp].[Value] Is Null Or [Forms]![frmQAMain]![txtInsp].[Value]="",[InspectedBy],[Forms]![frmQAMain]![txtInsp].[Value])) AND ((QA.Inspector)=IIf([Forms]![frmQAMain]![txtQA].[Value] Is Null Or [Forms]![frmQAMain]![txtQA].[Value]="",[Inspector],[Forms]![frmQAMain]![txtQA].[Value])) AND ((QA.Closed)=IIf([Forms]![frmQAMain]![frmStatus].[value]=1,-1,IIf([Forms]![frmQAMain]![frmStatus].[value]=2,0,[closed]))) AND ((QA.OutsideAgency)=IIf([Forms]![frmQAMain]![frmInspBy].[value]=1,-1,IIf([Forms]![frmQAMain]![frmInspBy].[value]=2,0,[OutsideAgency]))));