Delete Query Fail

Hile_Troy

New Member
Joined
Sep 27, 2011
Messages
15
I am trying to run a simple delete query and for some reason, can't get it to work. Every time I run it I get Error 3086 - Could not delete from specified tables. Below is the SQL code for the query:-

DELETE DISTINCTROW Processes.*, [Risk Rating of Processes].*, Processes.[Process Number]
FROM (DeleteProcessTemp INNER JOIN Processes ON DeleteProcessTemp.ProcessNumber = Processes.[Process Number]) INNER JOIN [Risk Rating of Processes] ON Processes.[Process Number] = [Risk Rating of Processes].[Process Number]
WHERE (((Processes.[Process Number])=[DeleteProcessTemp]![ProcessNumber]));

I have already built Add and Amend queries in the same database that work fine, but this one has me stumped. Much thanks for any and all assistance offered.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Thanks, will try just deleting from the 'parent' table, cascade delete should take care of the other table. Will let you know if it works/ doesn't work.
 
Upvote 0
Thanks jackd, worked a treat, just got to suppress alerts now, but I know how to do that...

Actually, you may not know the best way. The best way is NOT to use DoCmd.SetWarnings but instead to use

CurrentDb.Execute "QueryName Or Query SQL Here", dbFailOnError
 
Upvote 0
Thanks boblarson, DoCmd.SetWarning didn't work anyway, but it runs without a hitch even if I don't suppress alerts. Happy days
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,472
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top