Ok, I have toned down this query to only pull 1 field for now. Once this one field is solved, I'll add in all the rest.
Code:
SELECT Archive_AuditDb.Week, Archive_AuditDb.RMs, SUM(iif(Audit_Defect_Codes_Audit1)![passemployee]=-1,1,0)/COUNT([DCN]) AS Audit1pct
FROM (Archive_AuditDb LEFT JOIN Audit_Defect_Codes AS Audit_Defect_Codes.Audit1 ON Archive_AuditDb.[PCH: Sponsor SSN] = Audit_Defect_Code_Audit1.Auditcode)
GROUP BY Archive_AuditDb.Week, Archive_AuditDb.RMs;
On the final pieces of both the SELECT and FROM clauses, the links are different. The SELECT clause creates "Audit1pct" while the FROM clause creates "Auditcode". These are both created into the Audit1 table. Since this is the temptable being created by the query, I cannot look at the structure of the table for editing. I'm not sure if this is where the error is. The code above tells me that the error is in the FROM clause. I have tried making "Audit1pct" the reference for both the SELECT and FROM clauses. It didn't work.
This is linked almost exactly as you built it originally. I changed only what needed to be which was tblcodes to Audit_Defect_Codes and Audit_Field_1 to PCH: Sponsor SSN. Banging my head against a wall here. I'm starting to think this is coming down to missing parenthesis.