I have a problem with adding a record defined by the type statement to a collection. I have tried to define the collection and the record both public and private and in a module.
eg:
Private Type groupRecord
name As String
no As Integer
Index() As Integer
End Type
private group as groupRecord
Private groupCol As New Collection
private sub checkGroup()
.....
groupCol.add group
.....
end sub
But I get this error message:
<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 also want to know if it is possible to ship a userdefined type as an argument in some way or define a public userdefined variable which can be modified from anywhere in the program. I really need to have acess to the collection from at least two forms. Or if there are any good suggestions for solving such problems when the vb datatypes can't be used.
Please help me with this...
thank you
eg:
Private Type groupRecord
name As String
no As Integer
Index() As Integer
End Type
private group as groupRecord
Private groupCol As New Collection
private sub checkGroup()
.....
groupCol.add group
.....
end sub
But I get this error message:
<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 also want to know if it is possible to ship a userdefined type as an argument in some way or define a public userdefined variable which can be modified from anywhere in the program. I really need to have acess to the collection from at least two forms. Or if there are any good suggestions for solving such problems when the vb datatypes can't be used.
Please help me with this...
thank you