mrtn
mrtn

Reputation: 13

MS Access Delete Query with Left Join

I am trying to run a delete query for all records in table 'CSD' that are not available in table 'Client Codes for dealing'. I am getting an error 'Could not delete from specified tables'

DELETE CSD.*
FROM CSD LEFT JOIN [Client Codes for dealing] ON CSD.CLIENT = [Client Codes for     dealing].ClientCode
WHERE ((([Client Codes for dealing].ClientCode) Is Null));

Upvotes: 0

Views: 659

Answers (1)

mwolfe02
mwolfe02

Reputation: 24207

In your comment you mentioned that [Client Codes for dealing] is a Union query. Anytime a UNION query is involved, the entire query is made read-only (see Why is my query read-only?).

The simplest thing to do is to turn your UNION query into a make-table query, then replace the name of the UNION query with the name of the temporary local table created by the make-table query.

Upvotes: 2

Related Questions