Deleting Multiple Records from different tables

dazstarr

Registered User.
Local time
Today, 20:32
Joined
Mar 19, 2007
Messages
132
Hi

I have a form called frmPupil where users create a pupil onto the database (into tblPupil). The users can then go off and use this pupil to enter data in more forms which store in different tables using the PupilID.

I would like a button on frmPupil which will delete the pupil and any related records in the other tables via the PupilID.

Please can you tell how this is possible.

Many Thanks
Daz :)
 
Use cascade delete record when joining tables related records will automatically be deleted when the main record will be deleted
 
Hi

Hi

Thanks for the reply.

I tried that but I get the following error message....

Can't create this relationship and enforce referential integrity.....

Not sure why it says this, both data types are same (Autonumber/Number).

Please can you advise what I need to do?

Many Thanks
Daz
 
Reason is that you have some records in the child table which donot match parent table first delete that records and creat the relationship again
 
Last edited:
Thanks!

Thanks for your help - I will give it a go!

Thanks again
:)
 

Users who are viewing this thread

Back
Top Bottom