avanderlaan
Programmer
- Jul 11, 2002
- 156
I have the following declarations:
' in module.bas
Type StdsDocument
lDocId As Long
szDocumentNumber As String
szDocumentRevision As String
szDocumentName As String
End Type
' in a form
Dim documentDictionary As Dictionary
and am trying to execute
documentDictionary.Add rs(0), std
The error reported is "Compile error: Only user-defined typesin public object modules can be coerced to or from a variant or passed to late-bound functions."
The HELP explanation is "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. You attempted to use a public user defined type as a parameter or return type for a public procedure of a class module, or as a field of a public user defined type. Only public user defined types that are defined in a public object module can be used in this manner."
Could someone please explain what I am doing wrong and how to fix this? Thanx.
' in module.bas
Type StdsDocument
lDocId As Long
szDocumentNumber As String
szDocumentRevision As String
szDocumentName As String
End Type
' in a form
Dim documentDictionary As Dictionary
and am trying to execute
documentDictionary.Add rs(0), std
The error reported is "Compile error: Only user-defined typesin public object modules can be coerced to or from a variant or passed to late-bound functions."
The HELP explanation is "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. You attempted to use a public user defined type as a parameter or return type for a public procedure of a class module, or as a field of a public user defined type. Only public user defined types that are defined in a public object module can be used in this manner."
Could someone please explain what I am doing wrong and how to fix this? Thanx.