I tried adding a Group by Clause in the query, but I think I did something wrong. Now it keeps telling me "Undefined function '[PreApproved Main Table]' in expression." This is the SQL statement behind the query.
INSERT INTO [PreApproved Main Table] ( [Preapproval based on], [Group 1 Discount], [Group 2 Discount], [Group 4 Discount], [Group 5 Discount], [Group 5 (CCTV) Discount], Other, [Special Billing Terms], Salesrep, [Regional Sales Manager], [Area Vice President], [Date Approved], [Date Reviewed], [Additional Information], Autonumber, [Reference Number] )
SELECT [PreApproved Main Table].[Preapproval based on], [PreApproved Main Table].[Group 1 Discount], [PreApproved Main Table].[Group 2 Discount], [PreApproved Main Table].[Group 4 Discount], [PreApproved Main Table].[Group 5 Discount], [PreApproved Main Table].[Group 5 (CCTV) Discount], [PreApproved Main Table].Other, [PreApproved Main Table].[Special Billing Terms], [PreApproved Main Table].Salesrep, [PreApproved Main Table].[Regional Sales Manager], [PreApproved Main Table].[Area Vice President], [PreApproved Main Table].[Date Approved], [PreApproved Main Table].[Date Reviewed], [PreApproved Main Table].[Additional Information], [Autonumber]=Max([Customer Table]!autonumber) AS Expr1, [PreApproved Main Table].[Reference Number]
FROM [PreApproved Main Table]
WHERE ((([PreApproved Main Table].[Reference Number]) Like [forms]![Main Preapproved Form]![Reference Number]))
GROUP BY [PreApproved Main Table] ( [Preapproval based on], [Group 1 Discount], [Group 2 Discount], [Group 4 Discount], [Group 5 Discount], [Group 5 (CCTV) Discount], Other, [Special Billing Terms], Salesrep, [Regional Sales Manager], [Area Vice President], [Date Approved], [Date Reviewed], [Additional Information], Autonumber, [Reference Number] );
What do you suggest?