Quehay,
Sorry, but don't understand what you are saying re "you want to do this at design time", "using long levers to move the world" etc. The poster has said he wants to do this on a forms OnOpen event (ie. runtime); nothing about when he wants to raise the code.
Here are the basics as I see them relating to this thread(and I hav'nt done this 'dynamic coding' before, so I'm attempting to draw on some fundamentals to help answer this question).
(a) The Modules collection contains source code for the various modules within it. Review its properties and objects within to confirm this.
(b) Microsoft Access is an interpretive language, compiling "on the fly" if necessary to produce runtime (target) code which it then uses to execute the program code.
(c) The above being true, there is nothing to prevent a (new or existing) module's source code from being "prepared" from within Access (at runtime), for subsequent use.
(d) Once that module has been prepared and appropriately closed/saved, it becomes just another object in the database, waiting to service the application when called to do so (eg. no different to a querydef or tabledef).
(e) My brief investigation into this capability (prompted by this thread) leaves me confident that its not only possible, but is a design intention, consistent with the languages ability to create and maintain other types of objects from within.
SBendBuckeye,
I guess what I'm interested in, is what sorts of things you want to do in terms of customising your form code when the form is opened; Actually, you'd probably have to trigger your "Code modification code" BEFORE a form is opened, for the code to be invoked when the form is opened.
Please let us know what it is you're trying to achieve. If its a genuine candidate for "dynamic programming" then I think you'll spark some real interest; if not, then perhaps we'll be able to point you on how to achieve what you want with more traditional static code.
Cheers,
Steve