Using a user defined type and the Split Function
I have another problem with the split function. I can get the split funtion to work fine for user-defined types (String, integer, ect..) What I want to do is get the Split function to work on a user-defined type. Here is my user-defined definition that I created in a module:
Public Type MyStruct
First As String
Last As String
Phone As Long
Salary As Double
Here is the code I am trying to use to send the contents of the split string into this type:
Option Compare Database
Private Container As MyStruct
Public Sub Command0_Click()
Dim s As String
s = "Tim Mcarthy 8889099221 13000.93"
Container = Split(s, " ")
This is the error message I am receiving:
"Only user defined types defined in public object modules can be coerced to form a variant or passed to late bound function"