instance of class module can't see own type 
Author Message
 instance of class module can't see own type

I have declared a private type in the declarations section of a class
module.
When I create a new instance of it, its initialize event can't see the type.
I get a 'variable not defined' error.  Well, it certainly is defined.

Do initialization events occur before the declarations are evaluated?
Or are UDTs just not allowed in class modules?  They seem to be permitted in
form modules.

Thanks for your help.



Fri, 03 Aug 2001 03:00:00 GMT  
 instance of class module can't see own type
Hi Carlo,

Are you using them with the Me prefix? If so, try removing the keyword.

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------


t>...
:I have declared a private type in the declarations section of a class
:module.
:When I create a new instance of it, its initialize event can't see the
type.
:I get a 'variable not defined' error.  Well, it certainly is defined.
:
:Do initialization events occur before the declarations are evaluated?
:Or are UDTs just not allowed in class modules?  They seem to be permitted
in
:form modules.
:
:Thanks for your help.
:
:
:



Fri, 03 Aug 2001 03:00:00 GMT  
 instance of class module can't see own type
Carlo: make sure you are declaring a variable for your type and not
referring to the Type name itself:
Private Type MyType
    intValue as integer
    strValue as String
End Type

in initialization:
    Dim tmpType as MyType
    tmpType.intValue = 5
    tmpType.strValue = "This is a test"

This type of syntax works

t>...

Quote:
>I have declared a private type in the declarations section of a class
>module.
>When I create a new instance of it, its initialize event can't see the
type.
>I get a 'variable not defined' error.  Well, it certainly is defined.

>Do initialization events occur before the declarations are evaluated?
>Or are UDTs just not allowed in class modules?  They seem to be permitted
in
>form modules.

>Thanks for your help.



Sat, 04 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Instances of custom class modules

2. Instancing Class Module

3. handle a excel/word instance in a class module

4. The size of a class module instance

5. Memory required for a class module instance

6. handle a excel/word instance in a class module

7. Creating a new instance of Winsock in a Class Module

8. class module, instancing attribute multiUse or SingleUse?

9. Class modules 97 - Refering to array within a custom class module

10. Accessing procedures of a class module from another class module

11. Canned AcctReceivable Module needed!

12. Protecting Property Procedure innards from module's own controls

 

 
Powered by phpBB® Forum Software