emi_sastra
asked on
How to know the control is a control a control array or not?
Hi,
I want to know a control is a control a control array or not?
Thank you.
I want to know a control is a control a control array or not?
Thank you.
ASKER
Hi,
I have to know it since it is a parameter for a function call.
In side the function I have to know it is a control array or not, so I know what to do.
Thank you.
I have to know it since it is a parameter for a function call.
In side the function I have to know it is a control array or not, so I know what to do.
Thank you.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you.
I help.
I help.
ASKER
Sorry,
It show the same value= "textbox"
I try :
Text1 = TypeName(Text1)
Text2(0) = TypeName(Text2(0))
Thank you.
It show the same value= "textbox"
I try :
Text1 = TypeName(Text1)
Text2(0) = TypeName(Text2(0))
Thank you.
I'm not sure if you still have trouble. This is what happens on my system.
Debug.Print TypeName(Text1) 'This is an array and returns "Object"
Debug.Print TypeName(Text2) 'This is a single instance and returns "Textbox"
Debug.Print TypeName(Text1) 'This is an array and returns "Object"
Debug.Print TypeName(Text2) 'This is a single instance and returns "Textbox"
ASKER
You are right.
Thank you.
Thank you.
Text1 is indexed and text 2 isn't, so the first two lines compile OK. The last two lines give
'Compile error: Method or data member not found', and
'Compile error: Wrong number of arguments or invalid property assignment', respectively.
Debug.Print Me.Text1(1).Text
Debug.Print Me.Text2.Text
Debug.Print Me.Text1.Text
Debug.Print Me.Text2(1).Text