Im dont understand what you mean by that.
below is the qyr that works in a mdb file but I cant seem to do this in
ADP
DELETE dbo_tbl_HoldOrderDetails_View.[ORDER#],
dbo_tbl_HoldOrderHeader.CustomerCode, dbo_tbl_HoldOrderDetails_View.*
FROM dbo_tbl_HoldOrderDetails_View INNER JOIN dbo_tbl_HoldOrderHeader ON
dbo_tbl_HoldOrderDetails_View.[ORDER#] = dbo_tbl_HoldOrderHeader.[ORDER#]
WHERE (((dbo_tbl_HoldOrderHeader.CustomerCode)="1"));
I'm pretty certain that you can only delete from ONE table in a Delete
query, and you're trying to delete from two.
If you have Cascade Deletes set between the Header and Details tables,
you should be able to delete * from dbo_tbl_HoldOrderHeader; the
dbo_tbl_HoldOrderDetails records will be deleted automatically by the
cascade:
DELETE dbo_tbl_HoldOrderHeader.*
FROM dbo_tbl_HoldOrderDetails_View INNER JOIN dbo_tbl_HoldOrderHeader
ON
dbo_tbl_HoldOrderDetails_View.[ORDER#] =
dbo_tbl_HoldOrderHeader.[ORDER#]
WHERE (((dbo_tbl_HoldOrderHeader.CustomerCode)="1"));
If you want to leave the header record alone and delete the detail
records, dbo_tbl_HoldOrderDetails_View will need to be an updateable
view, and you'll need to adjust the query to
DELETE dbo_tbl_HoldOrderDetails_View.*
FROM dbo_tbl_HoldOrderDetails_View INNER JOIN dbo_tbl_HoldOrderHeader
ON
dbo_tbl_HoldOrderDetails_View.[ORDER#] =
dbo_tbl_HoldOrderHeader.[ORDER#]
WHERE (((dbo_tbl_HoldOrderHeader.CustomerCode)="1"));
This will leave the header alone and delete all Detail records for all
customers with CustomerCode equal to "1".
John W. Vinson[MVP]