Okay you've convinced me. So all I need to do is go into the relationship
window and check enforce referential integrity and then check cascade delete
related fields?
Will you describe to me what this does. In the past, I have had problems
with messing with relationships and just want to make sure it doesn't happen
again. I assume what will happen is when the user hits the clear button on
the form (because they messed up that record and want to start over), it will
delete that parent record and also the child records that have the same
[Material Transfer Number2] assuming there is a relationship between the two
tables and through [Material Transfer Number2]. Thanks again for your help!
Well... it's not quite that simple, unfortunately. If you have a Form bound to
one table (you haven't described your forms or your tables so I'm guessing
here!) and a Subform bound to a related child table, the main table record
will be saved permanently to disk the moment you set focus to the subform;
each subform record will likewise be written out when you move to a new
subform record or back to the mainform. So it's too late to "clear the form" -
the data isn't IN the form anymore, it's actually been saved to disk.
You can *delete* the record (click in the select bar on the left, or use
Records from the menu, or various other options); this will actually go back
out to the stored records in the table and delete them. You do need to be
careful - some inexperienced users will delete a record thinking "I don't want
this account to show up on this report", not realizing that they are
pemanently deleting the record and all related records from that report and
all other possible future reports! But if it's in fact a record that was
entered erroneously, then yes, cascade deletes will let you delete it.
The Clear button (if you program it yourself) can certainly be set up to
delete the record - and to let cascade deletes delete the related records.
John W. Vinson [MVP]