hi guys i have 3 tables in ms access that is patient , NOK,and admission they have related fields, i am using vb 2005. when i delete a record from the patient table i want the related records from the other tables to be deleted, can any one help me the code to accomplish that . thanks

In your MS Access database, if you do not have already defined the relations between the tables, do it using the data base tools. The Patient should be the "Parent" table and NOK and Admission should be "Children"

When defining the relations, see on the bottom a check box to cascade delete the related records.

Then, issuing a delete againsi the Patient will kill the children table records related to the deleted patient.

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.