Where to place the Event Procedure

MarionD

Registered User.
Local time
Today, 15:03
Joined
Oct 10, 2000
Messages
425
Hi all,
Would appreciate a bit of help if possible:

I have a form which contains 2 Sub forms. When a record is clicked in the one Sub form (datasheet) the corresponding records are shown in the other Sub forms.(also a datasheet)

What I Need: When a record in the first Sub form is deleted by pressing the delete button, I Need to check if there are any connected records in the other Sub form (table behind the form) and delete these first, before deleting the main record. I have tried putting the Event procedure on the "on delete" Event of the first form, but it somehow doesn't work properly. (it doesn't refresh (requery?) the second Sub form.
I have tried putting it on "before delete" but it doesn't work properly either.
Sorry if the properties are not named correctly.. I am on a german system
 
Hi all,
Would appreciate a bit of help if possible:

I have a form which contains 2 Sub forms. When a record is clicked in the one Sub form (datasheet) the corresponding records are shown in the other Sub forms.(also a datasheet)

What I Need: When a record in the first Sub form is deleted by pressing the delete button, I Need to check if there are any connected records in the other Sub form (table behind the form) and delete these first, before deleting the main record. I have tried putting the Event procedure on the "on delete" Event of the first form, but it somehow doesn't work properly. (it doesn't refresh (requery?) the second Sub form.
I have tried putting it on "before delete" but it doesn't work properly either.
Sorry if the properties are not named correctly.. I am on a german system

Have you thought about creating a one-to-many relationship with referential integrity? This would make it so that when the main record is deleted all sub records would be deleted as well.

http://grok.lsu.edu/Article.aspx?articleId=4605
 
Thanks so much for the reply. Seems to work fine!

Marion
 

Users who are viewing this thread

Back
Top Bottom