Discussion Locked

Using class modules is separate mdb file

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is there a way to use a class module in an other database? For example, I have project1 with class module referedClass and project2 (with a reference to project1) I have a class referingClass and attempting the following:

Dim mreferedClass as referedClass

Sub setup()
set mreferedClass = new referedClass
' . . .
end sub

I then create an instance of referingClass but this results, when running setup, in a user-defined type not defined error at the Dim statement.

Thanks in advance . . .

John

2 replies

by glyall

usually a class module is written for just one class

the fields in the database will be different for each class module. The record length is also differnet.

If you are writing it and you made the record length the some for all databases it might work.
And the fields and the field length need to be also the some length.
This would be a major problem.
Hard to know what new fields, field lengths, and number of record will be in the future

good luck

by jleather

This is more of a programming issue not directly database related. I will try to rephrase the questoin a little better. Thanks.

This discussion is closed to new replies.