Delete record from multiple tables

A

Alias

Hello,

I want to be able to delete a employee record from 3 different tables. Up to
now I have been opening each table and deleting the records manually but this
is tedious, not to mention dangerous.

Is it possible to have a combo box that lists each employee and will delete
the selected employee record from all 3 tables? I'm open to other methods
that will achieve the same.

My tables are listed below:


Employees ( Table 1 )
-------------------------
Employees_ID ( PK )
Emp_Name


Main ( Table 2 )
-------------------------
Main_ID ( PK )
Employees_ID ( FK )


EmployeeCourses ( Table 3 )
 
T

tina

if you set up cascading deletes for those primary/foreign key combinations
in the Relationships window, then deleting a record from the Employees table
will automatically delete the related records from the other two tables.

hth
 
A

Alias

Tina,

You were absolutely right about the cascading deletes defined in the
relationships window. Deleting an employee in the employees table also
deleted the same employee record in the other two tables.

Thank you very much for your help with this :)


tina said:
if you set up cascading deletes for those primary/foreign key combinations
in the Relationships window, then deleting a record from the Employees table
will automatically delete the related records from the other two tables.

hth
 
T

tina

you're welcome :)


Alias said:
Tina,

You were absolutely right about the cascading deletes defined in the
relationships window. Deleting an employee in the employees table also
deleted the same employee record in the other two tables.

Thank you very much for your help with this :)
 
Top