I have a class that uses a UDT (user-defined type) defined in a .bas module. I would like to pass a variable of this type to the class's function but every variation of this that I try results in an error message similar to 'Only public user-defined types defined in public object modules can be passed... blah, blah,".
Here's a code example:
Code in module:
Public Type Employee
Name as String
Age as integer
End Type
Code in class (Class1):
Public Sub HireEmployee(Emp as Employee)
...
End Sub
Code in a form:
Public Sub Command1_Click
Dim Emp1 as Employee
Dim EmpClass as new Class1
EmpClass.HireEmployee(Emp1)
End sub
-----------------------------------
Produces the following error:
"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"
Here's a code example:
Code in module:
Public Type Employee
Name as String
Age as integer
End Type
Code in class (Class1):
Public Sub HireEmployee(Emp as Employee)
...
End Sub
Code in a form:
Public Sub Command1_Click
Dim Emp1 as Employee
Dim EmpClass as new Class1
EmpClass.HireEmployee(Emp1)
End sub
-----------------------------------
Produces the following error:
"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"