SmokinWrek
IS-IT--Management
I'm trying to assign a variable dim'ed as a UDT to a dictionary item, but am having problems.
When I define the UDT and variable within my form module like this:
I get a compile error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions.
So, I put the declaration into a module as such:
...and call it the same way I had been from my form module, but I get the same error.
Is it not possible to do what I'm attempting to do? I understand that I can't use an array as a dictionary key, but according to the VB help, a dictionary item can be "any form of data".
Please, can I get a little help and direction with this?
When I define the UDT and variable within my form module like this:
Code:
Private Type DataInfo
fldInd As String * 1
fldName As String
fldPos As Long
fldLen As Long
fldMax As Long
fldMin As Long
fldCnt As Long
fldWithData As Long
End Type
Dim aryDataInfo As DataInfo
dict.Item(x) = aryDataInfo
I get a compile error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions.
So, I put the declaration into a module as such:
Code:
Public Type DataInfo
fldInd As String * 1
fldName As String
fldPos As Long
fldLen As Long
fldMax As Long
fldMin As Long
fldCnt As Long
fldWithData As Long
End Type
Public aryDataInfo As DataInfo
...and call it the same way I had been from my form module, but I get the same error.
Is it not possible to do what I'm attempting to do? I understand that I can't use an array as a dictionary key, but according to the VB help, a dictionary item can be "any form of data".
Please, can I get a little help and direction with this?