Delete records with multiple relationships

mabbutt

New member
Local time
Today, 17:02
Joined
Jul 4, 2006
Messages
7
Hi

I am in the process of designing a sports database and have come across a problem that I can not seem to fix.

I have 3 tables that are linked, they are Customer, Program (this is the customers exercise program) and Health (the customers health records).

I have tried to set up a query that deletes a customer if a command button is clicked. This works find as long as the table I am deleting the data from is not linked to another table.

However when I try to delete a customer record it says that I can't as the data is linked and I have to delete the relationships first.

The only way I can think of doing this is to setup a query that deletes all the data in each table at the same time. I can not get this to work though.

Is this a problem that can be solved or will I have to change the way my relationships are set up?

I would appreciate any help or suggestions.

Thanks
 
Hello mabbutt!

Look at EDIT RELATIONSHIPS mask.
You can see ENFORCE REFERENTIAL INTEGRITY (select it),
and CASCADE DELETE RELATED RECORDS (select it).
You don't need two or more query.
 
Hi MStef

Thank you so much!

I was obviously making this a lot harder than it needed to be.

I love it when the answer is a simple one.

Thank you again !!!
 
Hi Uncle Gizmo

I like that idea and it makes great sense.

I will have a look at implementing that into my database.

Thanks for the suggestion !!!
 

Users who are viewing this thread

Back
Top Bottom