H
Hendy88
Howdy all,
I'm playing around in a test database I've created and am having a
difficult time setting up a Delete Query that checks for a field in
two other tables and if it's there, it deletes the record in the
original table. So for example, I've got a table I called "NEW DATA"
that has the following fields:
CLAIM MVA RA VIN
I've got two other tables (one called "2005 DATA" and one called "2006
DATA") and I want the delete query to check for the MVA that's in the
NEW DATA table, in these two tables and if it finds that it's in
either one of these, I then want the record deleted in the "NEW DATA"
table.
In my Design View for this Delete Query I have all THREE tables with
the following relationships:
NEW DATA (MVA) Field -> 2005 DATA (MVA) field
NEW DATA (MVA) Field -> 2006 DATA (MVA) field
And for my setup I have the following:
Field: NEW DATA.*
Table: NEW DATA
Delete: From
Field: MVA
Table: 2005 DATA
Delete: Where
Criteria: [NEW DATA]![MVA]
Field: MVA
Table: 2006 DATA
Delete: Where
Criteria: [NEW DATA]![MVA]
But when I run it, it says "Cannot delete from specified tables."
Even taking out the extra table and just doing, let's say for example,
NEW DATA and 2005 DATA tables, still produces the same result.
Have I designed this backwards?
I'm playing around in a test database I've created and am having a
difficult time setting up a Delete Query that checks for a field in
two other tables and if it's there, it deletes the record in the
original table. So for example, I've got a table I called "NEW DATA"
that has the following fields:
CLAIM MVA RA VIN
I've got two other tables (one called "2005 DATA" and one called "2006
DATA") and I want the delete query to check for the MVA that's in the
NEW DATA table, in these two tables and if it finds that it's in
either one of these, I then want the record deleted in the "NEW DATA"
table.
In my Design View for this Delete Query I have all THREE tables with
the following relationships:
NEW DATA (MVA) Field -> 2005 DATA (MVA) field
NEW DATA (MVA) Field -> 2006 DATA (MVA) field
And for my setup I have the following:
Field: NEW DATA.*
Table: NEW DATA
Delete: From
Field: MVA
Table: 2005 DATA
Delete: Where
Criteria: [NEW DATA]![MVA]
Field: MVA
Table: 2006 DATA
Delete: Where
Criteria: [NEW DATA]![MVA]
But when I run it, it says "Cannot delete from specified tables."
Even taking out the extra table and just doing, let's say for example,
NEW DATA and 2005 DATA tables, still produces the same result.
Have I designed this backwards?