SubForm deletion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Main Form with a SubForm (Parent/Child).

If user makes errors in the input, there is the option to DELETE the entire
input - but my DELETE RECORD button only deletes the Main Form, leaving any
entry in the subForm as a record.

How can I delete both the Main Form and the SubForm with the one DELETE
action?

Glynn
 
It depends on how you enforce the Referential Integrity of the One-to-Many
relationship (assuming the "One" Record is on the Main Form and the "Many"
Records are on the Subform).

If you have R.I. enforced with the option Cascade Delete, the related "Many"
Records will be automatically deleted as soon as the "One" Record is
deleted.

If you don't use the Cascade Delete option, you will need to delete the
related "Many" Records by code. This need to be done (just) before you
delete the "One" Record if you have R.I. enforced (without the Cascade
Delete option).
 
Back
Top