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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



(since they usually don't come
with a built-in IDE, they have to allow it).

Ah, but they don't have a built in forms object either...do they?

The problem here is not the IDE, but the fact that you have a forms object
that is already made for you, and is not
a "generated" piece of code...

If you plan to build and write your own forms object from scratch, then this
is not a problem.....

Further, as mentioned, it is not much work to put that ONE line of code in
the event of your choice anyway. (so, it not a big problem). In fact, you
could certainly add a list of PUBLIC functions to a form. Remember, ANY
function defined as public becomes a method of that form. You still have to
put in the calling code (stub) for each control, but as I said before, this
is generally not a problem.

I do think that the events of a forms object should be able to be sunk into
a class object module. In fact, in some cases, you can do this, but as I
mentioned, you wind up hard coding the forms object anyway. The use of
withevents is explained here:

http://www.databaseadvisors.com/newsletters/newsletter052002/0205CombiningRaiseEvents%20.htm


but it
wouldn't help me out unless I could modify the base Form class to use
my event handler system.

Well, VB6, and ms-access allow the use of class objects, but they are not a
OO language. You simply have to put in code stubs. I suppose you could write
code to generate those stubs for you.....


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


.