Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 3061 to few paramiters

Status
Not open for further replies.

akcam2006

MIS
Jan 20, 2005
8
US
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]))));
 
Replace this:
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)
By this:
bJobCount2 = DCount("Kit_Type", "qryQAFilterTA", "Kit_Type = " & Chr(34) & Me![Kit_Type] & Chr(34))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top