John Colby
jcolby at colbyconsulting.com
Fri Jun 6 09:13:08 CDT 2003
LOL. I think the man is happy! You're welcome! Just as an aside, I now routinely go through this process so that each and every class is exposed. BTW, I learned about this from using an FTP class from Dev Ashish and Terry Kreft. It came in a lib, and worked just fine. I tried to move it into my framework lib and it no longer worked. Of course I had simply imported it. The process of importing a class apparently resets those two attributes back to False (Thanks Microsoft for protecting us children). It took several days of research and asking (this list I believe, Shamil provided the answer IIRC) to get the solution I passed on to you. John W. Colby www.colbyconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Bob Bedell Sent: Friday, June 06, 2003 10:02 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Where does WithEvents go? Outstanding! Phenonmenal! This is great! Think of the endless possibilities! Oh, it worked... That's great John. clsInventory is now "creatably" exposed to my event sink app, with custom events firing and all. Thanks for adding several productive years to my life. Bob >From: "John Colby" <jcolby at colbyconsulting.com> >Reply-To: accessd at databaseadvisors.com >To: <accessd at databaseadvisors.com> >Subject: RE: [AccessD] Where does WithEvents go? >Date: Fri, 6 Jun 2003 08:56:25 -0400 > >Bob, > >Classes built directly in a library database are not visible outside of the >library in VBA. No Se Por Que. I guess that since Microsoft considers VBA >developers to be children, giving us such powers is considered dangerous - >kinda like playing with knives or matches I suppose. At any rate, it >absolutely is possible to get your classes exposed such that they can be >seen and used outside of the library. > >The easiest way to do this is to: > >1) Export the class to a text file. >2) Open the class module with a text editor >3) Look for two attributes at the top of the module. Change Creatable and >Exposed to True. >4) Save the class and close the text file. >5) In your library, click Insert / Class module >6) In the editor window that opens, click Insert / File. Navigate to and >select the txt file that you saved the class in. This will cause Access to >pull in the contents of whatever file you selected and insert it in your >class. In this case it is the contents of the modified class. >7) At the top of the class you will see something like: > >Option Compare Database >Option Explicit > >VERSION 1.0 CLASS >BEGIN > MultiUse = -1 'True >End >Option Compare Database >Option Explicit > >Select and delete everything from the first Option down through the End. > >8) Compile and save the class > >The class will now be visible from any database that references your >library. >John W. Colby >www.colbyconsulting.com >