Delete Query not working (1 Viewer)

simongallop

Registered User.
Local time
Today, 19:11
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!
 

EMP

Registered User.
Local time
Today, 19:11
Joined
May 10, 2003
Messages
574
Try this:

DELETE *
FROM tblA
where fld1 & " " & fld2 in (Select fld1 & " " & fld2 from qryB)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:11
Joined
Feb 19, 2002
Messages
43,486
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

Top Bottom