I have a table TBLClient and it has a subdatasheet based on a table called
TblCaseNote Unfortunately when I delete a Client from TBLClient the subtable
doesn't delete the corresponding CaseNote. I tried changing the relationship,
and adding a new row called NewID but it is still doing the same thing. Any
ideas?
First off... subdatasheets are a MAJOR drag on performance, are never
necessary, and should be avoided. You should *not* be looking at table
datasheets in any case - Forms with Subforms are a much more powerful and
flexible option!
That said, open the Relationships window (it looks like three little
datasheets with lines between them). The subdatasheet misfeature will have
created a relationship between TBLClient and TBLCaseNote. You may need to
select View... Show All Relationships to see it.
Click on the join line between these two tables and view the relationship's
Properties. Check the "Cascade Deletes" check box. This will cause all case
notes for a client to be permanently and irrevokably destroyed, losing all
your history of the case forever, if you delete a client - if that's what you
want to happen, then go for it!
You might instead want to consider adding a yes/no field Active to the Clients
table, defaulting to True; set it to False to take a client off the active
list, and base your forms and reports on a query selecting only active
clients.