I have a query that attempts to delete all the records of a table that have fields that match those of a second table. I had this problem before and someone recommended that I was trying to delete records from more than one table. Before I figured out a way to eliminate the reference, but in this case I really need it. I'm a SQL newbee, but here's my code for what its worth:
tblInvoiceOldVars is the table I want to modify. If I get rid of the reference to tblInvoiceCalcs in the FROM line then it works fine, except that I get prompted for the field values in tblInvoiceCalcs, which obviously isn't what I want.
Thanks in advance,
Rich
Code:
DELETE tblInvoiceOldVars.*, [tblInvoiceOldVars].[InvoiceNum], [tblInvoiceOldVars].[JobNumber]
FROM tblInvoiceOldVars, tblInvoiceCalcs
WHERE ((([tblInvoiceOldVars].[InvoiceNum])=[tblInvoiceCalcs]![InvoiceNum]) And (([tblInvoiceOldVars].[JobNumber])=[tblInvoiceCalcs]![JobNumber]));
Thanks in advance,
Rich