Parameter for Class_Initialize event

  • Thread starter Thread starter Vilem Sova
  • Start date Start date
V

Vilem Sova

I'm wondering if it's possible (and if so how because I get errors when I
try) to add an optional parameter to a class module's Class_Initialize
event. This is so I can instantiate a new object and identify which object I
want to instantiate at the same time - something like Set clsMyObject = New
CuteOjbect(lngObjectID). But note that I want the parameter to be optional.

Thanks,
Vilem Sova
Canberra, Australia
 
Hi,
No can do in VBA. You have to do it in two steps.
Instantaite the object and then set the ID property.

You *can* do this in .Net because even VB has class constructors now.
Of course, that's no help in Access for now.
 
Back
Top