After searching online for awhile, I have discovered many people with this same question, but no answers. I'm trying to create an update query that sets the value of the field to the result of a subquery. However, when I try to run the query I get an error message that says "Operation must use an updateable query." My research tells me that it is because of the subquery. Here is what I have so far:
I suppose that I could replace the subquery with a DLookup() function, but I don't know the syntax to have three criteria. As those are the only two options that I know of, I don't know how to procede.
Code:
UPDATE tblACHFiles INNER JOIN tblInvoices ON tblACHFiles.InvoiceID = tblInvoices.InvoiceID SET tblACHFiles.InvoiceID = (SELECT InvoiceID FROM tblInvoices WHERE CustomerID = Forms!frmCustomer!CustomerID AND BeginDate = Forms!frmCustomer!txtStartDate AND EndDate = Forms!frmCustomer!txtEndDate) WHERE (((tblACHFiles.[ACHCompanyID])=[Forms]![frmCustomer]![CustomerID]) AND ((tblACHFiles.[EffectiveDate])>=[Forms]![frmCustomer]![txtStartDate] And (tblACHFiles.[EffectiveDate])<=[Forms]![frmCustomer]![txtEndDate]));
Comment