We got a ms-access database we use as a framework.
So we use a function we call "Update framework" where we transfer some modules from the framework to the target database with this code
db_fw.DoCmd.DeleteObject xxx_obj_t, rec_ref!REFR_NAME
...
db_fw.DoCmd.TransferDatabase acImport, "Microsoft Access", dCopiedFrameworkFile, xxx_obj_t, rec_ref!REFR_NAME, rec_ref!REFR_NAME
This works fine about 99% of the times.
But since some time I found out that sometimes - very rarely - instead of replacing the module, ms-access creates a module with the same name but a number at the end.
e.g. Module "ICanAfterStart" is not visible anymore. Instead a module "ICanAfterStart1" is visible. All the code works as before. So "implements ICanAfterStart" still compiles and seems to work.
When I update the framework once again, a module named: "ICanAfterStart2" (and so on) is created.
Until now this only happened with interface modules which we always name with an "I" at the beginning.
I already tried:
decompile the database
compress & repair the database
Application.SaveAsText; delete all visible "ICanAfterStart*" modules and try to use Application.LoadFromText to reimport the module. But Application.LoadFromText results in an "run-time-error 2950: reserved error"
I created a new module called "ICanAfterStart" where I copied the code as text into. But after the next framework update "ICanAfterStart" is not visible anymore and "ICanAfterStart1" is there.
As a "solution" for the moment I try backup files until I find one which does not have this error. As this is a lot of work and I have to recreate all the code I wrote until then, this is a bad solution.
So, does anyone know what the problem is and got a more practical solution for me?