deleting related records at once

M

mhmaid

I have two related tables
Expense reports
expense details

with one linking key ExpenseReportid
suppose i want to delete one record from the first table , together with the
related record/s from the other table. how this can be done.
thanks
 
J

Jeff Boyce

You've described "how" you are trying to do something ('delete record plus
related records').

Now, how about if you describe "what" ... as in what will deleting these
records allow you to do? It may be that it is unnecessary to delete
anything?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

IF you have set up relationships in the relationships window between the
two tables, you should be able to click on the relationship line and set
Cascade deletes on. That will automatically delete the related many
side (Expense Details) records when the one side (Expense Reports)
record is deleted.



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Top