How to safely delete linked records in Access

howling_muffin

New member
Local time
Today, 09:13
Joined
Jul 29, 2020
Messages
11
I'm creating a database in Access and VBA, and I'm trying to figure out how to delete records correctly and safely.
What I'm trying to do is simply delete a record and all its foreign key'd records cleanly, without #Deleted showing up in the table.

There doesn't seem to be any documentation on this, and I'd really appreciate some professional advice seeing as it's my first foray into VBA and databases and I'm sort of hacking my own path.
 
If you have enforced "Referential Integrity" and "Cascade Delete Related Records" in your relationship then related records one the many side will be deleted by access when you delete a record on the one side.
Tables should be used to store data rather than Add/Edit it.
The #Deleted that you see can be removed by performing a requery when editing using a form.
With a table I think you would need to close and reopen it.
Once in use it might be better to flag a record as no longer needed rather than actually deleting it.
 
or you can sort or filter the table which forces a requery
 

Users who are viewing this thread

Back
Top Bottom