perkc has your answer Justin. Just be warned that without proper planning, Cascade Delete can have some rather sad outcomes...
Main Topics
Browse All TopicsI have three tables with the following relationships
Customer Details 1 to M Contacted Details
Customer Details 1 to M Clients Contacts
All with the field CustomerID
CustomerID No Duplicates in Customer Details
Duplicate of CustomerID exist in the other two tables
How would I set up a delete query to delete a CustomerID and all related record info.
Heres what I've tried.
I set up a delete query working from a form where you select a CustomerID from a combo list (Read directly from Customer Details Table)
To cut a long story short I have messed about with no joy.
Any solution will be greatly rewarded
Thanks
Justin
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Like where perkc was going
what you could do if you do not have cascading deletes is this:
set up queries that delete that CustID from each table
the criteria for custID in the query would be
forms!yourFormName!combobo
(make sure you have the "bound column" set properly on the combo box)
on a button's click event
dim response
response = msgbox("Confirm delete", vbyesNo)
if response = vbyes then
docmd.setwarnings false
docmd.openquery "query1"
docmd.openquery "query2"
docmd.openquery "query3"
docmd.setwarnings true
end if
That'll fix you up.
Business Accounts
Answer for Membership
by: perkcPosted on 2003-10-07 at 08:38:07ID: 9506576
Have you set up cascading deletes/updates on your table relationships?
If so, then try:
custid = ???
CurrentDb.Execute("Delete * from [Customer Details] Where [CustomerID]=" & custid & ";")
Otherwise you will need to delete from all three tables using a method like the above.
perkc