[AccessD] bill's question

John Colby jwcolby at gmail.com
Sat Jan 29 11:30:30 CST 2022


*Don’t you need to use WithEvents in the class if you expect to sync the*
* events?*

Yes, any objects which need to sink events must be declared WithEvent.


*Don't you need to declare the main variable in the Class publicly if you*

* intend to have access to it from outside the class? *

I try to use private variables  where possible

*Or are you intending to write some kind of public property Set/Get
routines?*

A property get for returning things, IIRC including objects.

 *Also, I have not been successful trying the latter, I kept getting a
invalid property type when compiling.*

It does work.

*Where are you putting Function_Init?.*

The init function is in any clsXYZ that needs to be passed in things.  So
it would be in clsFrm, clsCbo etc.  It is used to receive the pointer to
the form or combo etc back in the main form class.

*What command calls this function and what are you passing to it?*

I usually initialize all of these things in OnOpen event of the main form.
I am passing pointers to controls in general

Where is the New keyword? If you don't use the New keyword, how can you
create an instance of your class?

when I create an instance of my frmClass, in OnOpen generally

in the header... dim gclsFrm as clsFrm

in OnOpen

Set gclsFrm = new clsFrm
gclsfrm.mInit me
read this blog post

http://jwcolby.blogspot.com/2013/02/a-form-wrapper-to-control-them-all-in.html?view=sidebar

-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list