Another One o_O

Rixx

Registered User.
Local time
Today, 13:52
Joined
Mar 3, 2005
Messages
25
It seems my database is a continuous array of never ending problems! My current problem is that of a DELETE query!

Is there any one out there that knows how to delete a complete record from a Products table (with the ProductID as the criteria), even if there are related records in other tables (e.g. Order details and Order queries).

At the moment I have Multiple Command buttons on a form that is running each query separately, deleting the related information first, before finally deleting the Record in the Items table (the last button).

It would be so much better if I could do this in one operation e.g. I have Items marked 'Discontinued' in my products table and a query that deletes all records that are marked as 'Yes' for Discontinued. But it wont do this because there are related records in other tables! I receive a Microsoft locked error :(

Any help will be greatly appreciated.

Thanks
 
For anyone else that may be experiencing this problem now or in the future, the solution lies within the relationships. You have to enforce referential integrity and cascade deletes...
 

Users who are viewing this thread

Back
Top Bottom