Connecting Tech Pros Worldwide Forums | Help | Site Map

mdb as reference problem...

Matthew Wells
Guest
 
Posts: n/a
#1: Jul 11 '07
I have an mdb with class modules that I use as a reference for another mdb.
The library is called MyLib.

I'm trying to declare variables in my front end mdb as class objects in the
library

Dim x as MyLib.ClassModuleName

This doesn't seem to work. When I type MyLib. and the intellisense pops up,
all I see are public functions and enums. I don't see any class module
names. How do I expose them?

Thanks.

Matthew Wells
Matthew.Wells@FirstByte.net





UrbanSpaceman
Guest
 
Posts: n/a
#2: Jul 11 '07

re: mdb as reference problem...


The way I work around this issue is to provide a public function in the
library which returns a new instance of the object:

Public Function New_ClassModuleName () as ClassModuleName
Set New_ClassModuleName=new ClassModuleName
End Function

"Matthew Wells" <Matthew.Wells@FirstByte.netwrote in message
news:o9KdnXmku_962AjbnZ2dnUVZ_r2onZ2d@comcast.com. ..
Quote:
>I have an mdb with class modules that I use as a reference for another mdb.
>The library is called MyLib.
>
I'm trying to declare variables in my front end mdb as class objects in
the library
>
Dim x as MyLib.ClassModuleName
>
This doesn't seem to work. When I type MyLib. and the intellisense pops
up, all I see are public functions and enums. I don't see any class
module names. How do I expose them?
>
Thanks.
>
Matthew Wells
Matthew.Wells@FirstByte.net
>
>
>
>

Marshall Barton
Guest
 
Posts: n/a
#3: Jul 12 '07

re: mdb as reference problem...


Matthew Wells wrote:
Quote:
>I have an mdb with class modules that I use as a reference for another mdb.
>The library is called MyLib.
>
>I'm trying to declare variables in my front end mdb as class objects in the
>library
>
>Dim x as MyLib.ClassModuleName
>
>This doesn't seem to work. When I type MyLib. and the intellisense pops up,
>all I see are public functions and enums. I don't see any class module
>names. How do I expose them?

Take a look at:
http://www.mvps.org/access/modules/mdl0034.htm

--
Marsh
Matthew Wells
Guest
 
Posts: n/a
#4: Jul 12 '07

re: mdb as reference problem...


This works great - with a few notes.

You don't have to rename the old class and create a new one. You can just
delete the code and import the text file.

When you import the text file, these lines will appear at the top. Just
delete them (unless someone knows something I don't).

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
End

Also, if you have any private classes that are used as parameters in the new
public class (paramaters and other stuff - you'll see in the error message),
you have to expose those classes as well.

But overall this is really GREAT!!

THANKS!!!




"Marshall Barton" <marshbarton@wowway.comwrote in message
news:nsqa93t4a9grqumssj0tqiudj58ebr76o9@4ax.com...
Quote:
Matthew Wells wrote:
>
Quote:
>>I have an mdb with class modules that I use as a reference for another
>>mdb.
>>The library is called MyLib.
>>
>>I'm trying to declare variables in my front end mdb as class objects in
>>the
>>library
>>
>>Dim x as MyLib.ClassModuleName
>>
>>This doesn't seem to work. When I type MyLib. and the intellisense pops
>>up,
>>all I see are public functions and enums. I don't see any class module
>>names. How do I expose them?
>
>
Take a look at:
http://www.mvps.org/access/modules/mdl0034.htm
>
--
Marsh

Closed Thread