Question Deleting Multiple Areas

chrisguk

Registered User.
Local time
Today, 01:50
Joined
Mar 9, 2011
Messages
148
Hi,

I have a form that comprises of Sub forms within tab controls.

I have placed a delete button on the main form to remove any unwanted records. There is a problem with this. You are not able to delete a main record when a child record exists in related tables.

How can I achieve this using a click function?
 
Its okay I worked it out.

Just use the Cascade delete and update functions in the Join type.
 
set up relational integrity, and enable cascading deletes. personally, i wouldn't do that though. alternatively modify your code do delete sub-records first , if there are any.

but why delete something with related records? A better solution is to tag the record as not required in some way.

depends on your system though.
 
further note

out of interest - the danger of cascading deletes is that it is so easy to remove stuff you don't really mean to. You need to be careful if you go that way.
 

Users who are viewing this thread

Back
Top Bottom