delete record from subform

H

hngo

hi,

I have create a form with a subform.
I has also create a delete record button to delete the record on the form.
However this doesnot delete records in the subform (which may contain
multiple records related to the record in the main form). Can anyone please
help me with this

Many thanks
 
D

Dennis

Make sure you have a relationship defined in your relationships window
between the main form data and the subform data. Right click on the line that
joins them and click edit relationship. Select Enforce referential integrity
and also select cascade updates and cascade deletes. This means when you
delete a main record, all the subform records related to it will also be
deleted.
 
Top