MichaelJ2 has a great post up on Removing a Reference to a Field or Object in VBA. Then David Musgrave picked up the conversation with his own take on the same subject. Both are definitely worth a read.
Removing a Reference to a Field or Object in VBA
Archived post from 2009. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.