Delete All Data related in a Form and Sub Form.

paulcherianc

Registered User.
Local time
Today, 05:28
Joined
Aug 15, 2013
Messages
86
:banghead:

Dear Experts:

I am a beginner in MS Access. Well I have developed a small software and now my issue is as follows:

I am not able to delete all related records in a subform and the form when clicking the delete option.

When i am clicking it should delete the project number and related records in the subform.

I have attached the database for your review.Can anyone help me in this regards,

Thanks in advance!

Paul C
 

Attachments

In the relationship view you need to change the relevant relationship lines. All relationships should be set to "Enforce referential integrity". Once you do this you then have the option to cascade deletes and updates.

But I think you need to look at your table/relationship structure in any case. You have a table called "Main table". What is this supposed to represent?

So in your form header it is unclear what it is supposed to be displaying. Is it a project? Also what is the subform supposed to display?
 
In the relationship view you need to change the relevant relationship lines. All relationships should be set to "Enforce referential integrity". Once you do this you then have the option to cascade deletes and updates.

But I think you need to look at your table/relationship structure in any case. You have a table called "Main table". What is this supposed to represent?

So in your form header it is unclear what it is supposed to be displaying. Is it a project? Also what is the subform supposed to display?


Hi Stopher,
I tried to change the relationships as you suggested. but still the delete button deletes data in the subform one by one and project number is not deleted from the project master table.

Well, "Main Table" stores all data selected from the Project Master Table and other related tables like activity master, item master etc.

Form "Project Master Final" is created for the user to select particular item, location, activity,dates etc through the sub form.

I am very poor in setting data relationship. Could you please guide me.:banghead:
 
open the relationship window.
right click on the line the connecting Project Master Final table and Main table.
select cascade update, cascade delete.
 

Users who are viewing this thread

Back
Top Bottom