I won't address the bit about the command button, but I was able to add a "Form_OnFormat" event routine for every report in a list of over 100 reports. The routine to be created wrote an entry in an auditing table every time the report header was formatted. It is unimportant as to what was actually logged. The fact was that Access wouldn't do it automatically and I couldn't get WindowsNT to identify individual reports using its own event logger. (No, I didn't expect WNT to do so, either.)
What I did to implement this was write a routine that visited each report in the database.Containers!Reports.Documents collection. In order to run the routine, I made it a public function and created a macro to do a RunCode of this function.
So OK, the routine gets run by the macro. It opens the database and starts enumerating the documents collection as noted above. Each document is the name of a report, which I opened.
If the report had a module, I did a search using the module.Find method to see if an auditing reference was already present. (The name of the auditing subroutine is distinctive enough that the search was never ambiguous. It was either present or not and there was never a name that could have even been close enough to cause confusion.)
If the report had no module, I created one for it. Turns out that even if there is no module present, all you have to do is open the report.Module object. Opening it creates a module if necessary. It is empty except for the default general header that ALL modules carry with them, the second line of which is usually "Options Database."
If the module lacked an auditing reference, I then performed a module.AddFromFile (from a pre-defined external file that held my generic auditing code. The included code looked up names using Me.Name and looked up other things in similarly generic ways.)
Once all of that was done for the report, I closed the module and report, then continued the loop over the Reports.Documents collection until this looped reached its natural end.
Voila! When it was done, I had created code in event routines for every one of several dozen reports. (The others already had the auditing code in place, but the .Find method told me that when I ran the update.)
So without regard to the "button" part of your question, I will say "emphatically yes you can create code in a module from another module."
I hope the above overview gives you at least a hint of how to approach this topic. I would include the code but this is a military site and I am not supposed to make specific code public. What I told you doesn't violate our security so feel free to use the approach.