var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Instantiate a class by name.
Is there a way in Microsoft Access to instantiate a class (defined through a class module) if you have it's name as a string variable?
Imagine I have this:
and want to create an instance of class cls_MyClass. Can't use Dim here, naturally, and it looks like eval() can't help me either. Is there a way out at all?
Thanks for your help.
Actually, if in your mdb you have a class module named cls_MyClass, you would create an instance of it with a Dim statement thus:
Dim myObject As New cls_MyClass
If that would be so, I wouldn't be asking, of course.
Once again: the name of the class to instantiate is specified as a _string variable_. I do not know it in advance, and thus cannot write the Dim statement.
In that case, no, it is not possible in Access. You must have the actual class name; you cannot use the New specification to create a new instance of a class with a string variable for the name.