standard Property definition in VBA

L

Le, Thanh-Nhan

Hi,

I habe a class, now I want to define, that the property "value" is the
standard property of this class.

That means, when I call:
dim v as variant
dim obj as class1
.....
v = obj
then v had the value.

Thanks
Nhan
 
A

Albert D. Kallal

From the debug window...use the "saveastext" to save the class module as
text file.

Now, delete the class module.

With a standard text editor, add the following line to the "LET" property
that you want be the default:

Attribute Value.VB_UserMemId = 0

Now save the next document,and back into ms-access at the debug prompt use

loadfromText
 
M

Mike Labosh

From the debug window...use the "saveastext" to save the class module as
text file.

Now, delete the class module.

With a standard text editor, add the following line to the "LET" property
that you want be the default:

Attribute Value.VB_UserMemId = 0

Now save the next document,and back into ms-access at the debug prompt use

loadfromText

That's awesome! I didn't think that was even possible in VBA because it
doesn't have the VB "Procedure Attributes" dialog. Excellent backdoor!
 
L

Le, Thanh-Nhan

Thanks, I will try it

Mike Labosh said:
That's awesome! I didn't think that was even possible in VBA because it
doesn't have the VB "Procedure Attributes" dialog. Excellent backdoor!
--
Peace & happy computing,

Mike Labosh, MCSD
"I have no choice but to believe in free will."
 
Top