m:
If you delete a Form in Access which has several objects on the
form (i.e. Combo boxes, buttons, text fields) does all the code
involved with those objects and the form get deleted or do you
need to to a decompile to get rid of the garbage?
Logic tells me that the part of the BLOB that stores the data is
going be marked as unused within the BLOB field where the Access
project is stored. But I don't know if Access is smart enough to not
have to rewrite the whole field in order to mark one delete flag. If
it can't, then there would be no reason to retain the discarded
code. But if it can, then the discarded code won't be deleted until,
well, I don't know when.
The BLOB data is not stored in the system table that holds the
record that the BLOB field is part of -- all that's in the table is
a pointer to the data pages where the BLOB data is stored. So,
likely only the data pages with the data relating to the deleted
object would need to be marked. Perhaps each object gets its own
data page until such time as it grows larger than a single data
page, so the delete would simple mark the data pages allocated for
the object as unused so they can be written over by other data, and
if still not in use, discarded on the next compact.
I don't trust VBA compilation to be smart enough to remove all
references to discarded data pages that hold compiled module code,
so I would always expect a decompile/compact/recompile/compile cycle
to be necessary to be on the safe side.
But I don't very often delete code-bearing objects.
I do decompile fairly regularly as part of the normal development
process, though. I haven't lost a line of code or a corrupted object
in at least 5 years.