Hi, I am trying to assign a variable the address of a collection object. I
want to use one several possible collections in an argument list. When I try
to assign the variable the address of the collection I get a compile error,
“Argument not Optional”
Here a code sample:
Private Function foo (level As GetRecipeLevel, …) As Boolean
Dim PKeyAddr As Collection
With myCollectionList
Select Case level
Case MenuCategoryLevel
PKeyAddr = .MenuCategory ' Collection Object of Menu Category
Names
Case RecipeTypeLevel
PKeyAddr = .RecipeType ' Collection Object of Recipe Type
Names
Case RecipeCategoryLevel
PKeyAddr = .RecipeCategory ' Collection Object of Recipe
Category Names
Case RecipeNameLevel
PKeyAddr = .RecipenName ' Collection Object of Recipe Names
End Select
End With
Call GetPrimaryKey (PKeyAddr)
End Function
------
Thanks for you help, it is greatly appreciated, Eddie Eytchison
Alex Dybenko - 20 Mar 2005 10:48 GMT
You have to use Set with object variables:
Set PKeyAddr = .MenuCategory

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
> Hi, I am trying to assign a variable the address of a collection object.
> I
[quoted text clipped - 40 lines]
>
> Thanks for you help, it is greatly appreciated, Eddie Eytchison
Eddie's Bakery and Cafe' - 20 Mar 2005 14:48 GMT
Alex, thanks for the feedback
> You have to use Set with object variables:
>
[quoted text clipped - 44 lines]
> >
> > Thanks for you help, it is greatly appreciated, Eddie Eytchison