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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

MyBoo

Board Regular
Joined
Aug 9, 2006
Messages
217
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.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,304
Office Version
  1. 365
Platform
  1. Windows
Why delete the record?

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

Forum statistics

Threads
1,141,741
Messages
5,708,238
Members
421,553
Latest member
aichabaddi

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
Top