[AccessD] events question

jwcolby jwcolby at colbyconsulting.com
Fri Dec 7 10:38:06 CST 2007


No, no easy way.  There is a way however... 

scroll down...

Oh never mind, it is called a framework.

1) You build a clsFrm
2) In clsFrm you create a function to scan the controls collection.  For the
moment the scanner will just try to set the mouseover property to call your
function.  Ignore errors.
3) In clsFrm you create an init(lfrm as form)
4) In each form just dim fclsFrm as form.
5) In the form's OnOpen Set fclsFrm = new clsFrm
6) clsFrm.Init me	to pass in a reference to the form

You now have a class that will be able to scan for controls.  That class
accepts a form as a parameter in it's init and calls the control scanner.
The control scanner (for now) just sets each control's MouseOver property to
the name of your function.

Obviously the other responders suggested a similar approach except they put
the control scanner directly in each form's "code behind form" class.  Less
elegant, less expandable but the same concept.

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Friday, December 07, 2007 10:55 AM
To: AccessD at databaseadvisors.com
Subject: [AccessD] events question

I don't know how to summarize this question, hence the bad subject. I
apologize.

I'm wondering if there's a way to consolidate similar event calls into one
event. For instance, if you want to passto/call a function from every
control's Mouse Over event, is there a simple way to do that with one call
rather than dropping the call into every single control's appropriate event?

I've run into this so many times and it just seems so inefficient.

Susan  H. 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list