Greetings loungers
I wish to toggle with code the Cascade delete option.
The problem involves 3 tables with 1 to M to M relationship.
Deepest sympathies from all New Zealanders to all victims of the atrocities in Manhattan.
Geof Richardson
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Cascade Delete & VBA (A2000)
Hi Charlotte
I want to give users the ability to delete a record in the primary table and the associated records in two related tables of the 1-M-M but I dont want to have cascade deletes as the default referential integrity settings.
I was thinking that I would create a routine that defined a delete querydef and toggle the cascade property of the relationship.
Am I barking up the wrong tree ?
Cheers & thanks
Geof
Like Charlotte, I’m a little baffled by the situation. The usual reason you disable cascade deletes is to protect data in a table from deletion, and as a way to help enforce referential integrity. If you are going to toggle cascade deletes, I’m not sure why you would bother to turn it off originally?
I’d leave it off and do a series of delete queries, working “upwards” from the lowest “child” table.
Hi Charlotte
Thanks for the thoughts.
In this case it is fine to move these records and delete the associated records.
This situation involves product pre purchase inspections. If a decision is made to purchase then a record is populated in the stock table. The inspection results are no longer needed.
I perceived a need to keep the tblStock and TblPP-Stock separate.
Probably breaking a few rules along the way. However all seems to be working at present.
Cheers
Geof
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications