I'm having a problem passing a user defined type to a function in one of my classes. I have declared a user-defined type in a module (a regular, "code" module) that looks like this:
Public Type Data_Comparison
Data_Level As Integer
Data_List() As Integer
Description As String
End Type
In a class module I have declared a function like this:
Public Function Search_RE_for_Duplicates(ByVal Comparison_Values As Data_Comparison) As Integer()
When I attempt to run the program, I get a compile error that says:
"Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types."
I'm confused, because this IS a public user defined type, and it IS defined in a public object module, as far as I can tell. Why is it giving me this error? The only thing I can think of is that I declare it in a regular module, and I'm guessing that when it says "object module" it may mean a class module. However, when I try to declare it in a class module, I get another error:
"Cannot define a Public user-defined type within a private object module."
Your help would be appreciated.
-Adrian
Public Type Data_Comparison
Data_Level As Integer
Data_List() As Integer
Description As String
End Type
In a class module I have declared a function like this:
Public Function Search_RE_for_Duplicates(ByVal Comparison_Values As Data_Comparison) As Integer()
When I attempt to run the program, I get a compile error that says:
"Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types."
I'm confused, because this IS a public user defined type, and it IS defined in a public object module, as far as I can tell. Why is it giving me this error? The only thing I can think of is that I declare it in a regular module, and I'm guessing that when it says "object module" it may mean a class module. However, when I try to declare it in a class module, I get another error:
"Cannot define a Public user-defined type within a private object module."
Your help would be appreciated.
-Adrian