tags:

views:

620

answers:

1

I found this question that is discussing what I would like to do, but it's for T-SQL. Is there a way to do something similar in Microsoft Access? The examples below are based off what I found in that question.

I need to delete all the records in TableA, which is linked to TableB via field Bid based on another field in TableB.

Here is the query that selects the items to be deleted:

SELECT * 
FROM TableA a
INNER JOIN TableB b on b.Bid = a.Bid
WHERE [my filter condition]

The following query results in an error "Specify the table containing the records you want to delete."

DELETE TableA 
FROM TableA a
INNER JOIN TableB b on b.Bid = a.Bid
WHERE [my filter condition]

Is this possible with an Access query?

+1  A: 

Hi Dennis, This should work:

DELETE TableB.Text, TableA.*
FROM TableA 
INNER JOIN TableB ON TableA.BID = TableB.BID
WHERE TableB.Text="foo";
Oorang
That did it. Thanks!
Dennis Palmer