Automatically updating one table from another

Deb6508

Board Regular
Joined
Oct 25, 2004
Messages
131
Hi All,
I have two tables in a database. One table contains personnel info and the other table contains training information. What I would like to have happen is when an employee is deleted from the personnel table that persons training information is then deleted automatically.
Any ideas or help I would greatly appreciate.
Deb
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
This would happen automatically if you had a relationship defined between the two tables.

How do you identify the training records associated with the personnel records now? If your personnel table contains a primary key... a unique identifier... EmployeeID (for example), you could add that field to the training table... but NOT as a primary key... as a foreign key. Then click on Tools/Relationships, display both tables and drag/drop the EmployeeID from the personnel table to the same field in the training table. This will display a window for you to create the relationship. Set it to cascade delete, then save.

When you delete a record from the personnel table, all associated training records will be removed from the training table.
 
Upvote 0
Why delete the record?

Couldn't you just add a field that indicates the current status of the employee?
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,446
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top