[AccessD] use of Public Type in Collections

Lembit Soobik lembit.dbamail at t-online.de
Sat Jan 26 05:31:41 CST 2008


I have tried some things here. the collection works with a string, but it 
doesnt want a user defined datatype, even if I make it public.
>From the help files I understand Collection works with ANY datatype.
Has somebody used Collection with a user-defined type?

thaynks
Lembit



> Hello All,
>
> with the following code in Access 2002 I get a compile error that
> reads(translated from German):
>
> Only user-defined types, which are defined in public Object-Modules, may 
> be
> converted to or from type Variant
> or passed to a function which is resolvable at runtime.
>
> ---------------start code-----------------------------
> Option Compare Database
> Option Explicit
>
> Public Type Verzeichnis
>    VzID As Long
>    VzPfad As String
>    VzParent As Long
> End Type
>
> Public Function testCollect() As Boolean
>    Dim ColPath As New Collection
>    Dim dirPath As Verzeichnis
>    With dirPath
>        .VzID = 1
>        .VzPfad = "J:\"
>        .VzParent = 0
>    End With
>    ColPath.Add (dirPath)<-------------------------Error: dirPath is marked
>
> -----------------------------------------------------------
>
> This code is in a module, not behind a form. Do I have to make this module
> public? if so, how?
>
> thank you
>
> Lembit
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.11/1242 - Release Date: 
> 24.01.2008 20:32
>
> 




More information about the AccessD mailing list