Delete Query not working

simongallop

Registered User.
Local time
Today, 18:24
Joined
Oct 17, 2000
Messages
611
Am trying to delete info from tblA that exists in qryB.

SQL: DELETE tblA.*
FROM tblA INNER JOIN qryB ON (tblA.fld1 = qryB.fld1) AND (tblA.fld2 = qryB.fld2);

I view the results in design view. Shows the 42 records that I want to remove.

Run the query: "Could not delete from specified tables"

The query is getting the records from a different table (tblB) so no circular issues there. The 2 tables are not linked as 1 is a current list and the second shows all changes in the last month and I am trying to reverse engineer the list for the beginning of the month. (Delete and then append the record from tblB). Minor problem is that I cannot delete and thus cannot work my way back.

Please help!
 
Try this:

DELETE *
FROM tblA
where fld1 & " " & fld2 in (Select fld1 & " " & fld2 from qryB)
 
Make sure that the two tables have primary keys defined. Access may be having trouble determining the cardinality of the relationship.
 

Users who are viewing this thread

Back
Top Bottom