This business of losing code in modules seems to be becoming more prevalent.
Might be just A2007 and A2010 because I’ve never had it happen in A2003.
In any case, attached is a little A2003 demo (A2000 file format).
It has some test cases, Form, Form with no module, Form with module but no code, Report with module and code, Report with module but no code, Standard 90k module, Class module with no code.
To run the test, open module mdlCheckModules and run Sub CheckModules.
What it should do is:-
1. Open every module it can find except module mdlCheckModules.
2. Build a list of modules in a table.
3. Check if the Form or Report has a module.
4. Check if the Form, Report, Standard or Class module has code.
5. If there is code then dump that code to a text file.
6. Produce a Report of the findings.
The text dump is done relative to the *.mdb file it is testing as in:-
Directory of Test File.
--- ModuleBackups
------Directory named the same as the file under test.
---------Directory Date/Time stamped.
---------Directory Date/Time stamped.
---------Directory Date/Time stamped.
It could be rewritten to allow a browse for file but that could also involve a password.
This has only been tested on A2003 MDB files so I don’t know how it would respond under later versions.
Edit:
Please be aware that some Forms need a class module even if there is no code in the module.
Chris.