Deleting Records on a Subform

  • Thread starter Thread starter Chip
  • Start date Start date
C

Chip

I just built a form (frm_Form1) with a subform (frm_Sub1)
(the tables are in SQL database) and was wondering when i
delete a record off "frm_Form1" will it delete the
corrosponding records related to it from frm_Sub1? If not
is there any way to set up the form where it will? I am
relativeley new to databases in general and VB for that
matter so please be gentle... THANKS IN ADVANCE!!!
 
Chip,

You should have setup a relationship between the primary key of the table the
main form is based on and the foreign key of the table the subform is based on.
Open the database window, go to Tables and open the relationship window. Double
click on the join line between the two tables. In the dialog that appears you'll
see three checkboxes. Check the last one "Cascade Delete Related Records". Now
when you delete a record in the main form, all records related to that record
will be deleted in the subform.
 
Thanks For the Reply, these tables are SQL tables only
linked to the database. This does not allow me select
Cascade Deleting. Is there a way we can do this in SQL
that you know of?

Thanks again!!!
 
Back
Top