The VBA code was written after the database was copied over to a test environment.  Copy the VBA code from the production database into the test database so that it will fire on the appropriate event.

The same is applicable in reverse.  A customization that was created in a test environment must be copied over to the production environment for use against the live database.