• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Delete record in Master-Detail Worksheets

inddon

Member
Hello There,

I have 3 worksheets as follows, 1 master and 2 details (pre-fixed with '2-'):
1. Header: This is the master worksheet and it contains the employee personal data
a. Primary Keys (Columns): Serial Number and Employee Number
2. 2-Address: This is the detail worksheet
3. 2-Contacts: This is the detail worksheet

for each record in worksheet 'Header' there might be a record in worksheets '2-Address' and '2-Contact details'. If there is a record, then it will have the primary keys from worksheet 'Header'.

When the user tries to clear or delete a record in worksheet 'Header', then it should start a routine to check, if there are any detail records for that "to-be" cleared or deleted record in the detail worksheets '2-Address' and '2-Contacts'. It should go through all the records in each detail worksheets. The check criteria is the 'Primary Key' columns from worksheets 'Header'.

If there exists a record, then it should display a message and the record should not be allowed to clear or to be deleted. If there exists no record, then the user can clear or delete the record in worksheet 'Header'.

I have attached a file for reference. Never did such a thing before.

Looking forward to hearing from you guys.

Thanks & regards
Don
 

Attachments

  • Delete Records - Master Detail Worksheets.xlsx
    10.7 KB · Views: 2
Back
Top