Re: Trying again (MVP, please note): programmatically setting up event handlers



Who designs this stuff?

What environment have you used that allows runtime resolution of your
function names? I just curious as to what you used that allows your code to
resolve a name at runtime?


addSomeCapability myButton, "custom text for button"...(and other
customization)

The idea is that this one subroutine would set up all the right event
handlers and all the right pieces of code.

Well, you can certainly write some code to open the form in design mode, and
make the changes. However, we are now talking about code that modifies other
code.

To define, and have your code change/modify at runtime is rather
daunting...do you think?

As I mentioned, exactly what developer background do you come from where
this is common practices? Perhaps some scripting environment that is
evaluated at runtime, and not compile time?

It's even worse when I realize two days later that my button handling
code has a problem. I have to go back to all the little pieces of code
(event if each one is just one line) and make some changes. It's hard
to be sure that I caught all the changes.

I note sure why the one line of code that CALLS YOUR "general" error routine
would need to be modified? (or your general contorl code?).

Why would the number of parameters change there?
This makes no sense at all. If those controls call your "general" code, it
is VERY unlikely that the calling code will need to be changed, or modified.
At the very most, we would be talking about a VERY small instance when this
happens. Having to modify the main code module that those controls calls
certainly makes sense, and you will often have to modify that code. But,
modify the calling code of one line? Hum, not a problem here.

You can download a free copy of mz-tools, and when in ANY routine, it will
pop up a list of CALLING routines. So, you could just open up your error
routine in the standard module, and a list of forms code that calls the code
would be available. However, this begs the question....are you really
saying that you have to change the parameters of those controls that calls
error code? I am hard pressed to ever much having to remember to do this,
and even more hard pressed to this ever being a developer problem.
..
Perhaps you are not explain something fully here?

Anyway, the free mztools is a great vba add-in, and you can find it here:

http://www.mztools.com/

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx
http://www.members.shaw.ca/AlbertKallal



.