TheSwamp

Code Red => VB(A) => Topic started by: uncoolperson on October 22, 2010, 11:43:37 PM

Title: adding code to a form event
Post by: uncoolperson on October 22, 2010, 11:43:37 PM
in access 97, is there a way to programmically add a sub call to an event procedure (aside for the addproc or whatnot that requires the form to be open, and actually write the code to the form module)?

have a big gigantic database that I need to add a call to a tracking sub to all the form_loaded events, and I can't figure out a handy way of doing this aside from actually doing this, and I'd prefer to only add something to the main form_load (don't have to undo everything to undo everything).
Title: Re: adding code to a form event
Post by: hugha on October 23, 2010, 10:37:44 PM
I'd try saving the code, editing with a decent text editor then reloading with hidden methods SaveAsText and LoadFromText as described here and elsewhere:

http://allenbrowne.com/ser-47.html
http://www.access-programmers.co.uk/forums/archive/index.php/t-99179.html

hth