Home All Groups Group Topic Archive Search About

Detecting Control Array VB6

Author
20 Mar 2009 3:25 PM
Rick
How do I detect when an ActiveX control in a form is part of an Array of
controls automátically?

For example, in a form I can have one commando button an two textboxes:

Command1
Text1(0)
Text1(1)

If I use IsArray instruction I get false in both. Command1 doesn't have the
Count property butText 1 does.

If I test for the count property on Command1, I get an Error.
Should I test the error Message?

Rick




--
Thanks,

Rick.

"For every problem, there is a solution that is simple, neat, and wrong."
H. L. Mencken"

Author
20 Mar 2009 4:10 PM
DanS
=?Utf-8?B?Umljaw==?= <R***@discussions.microsoft.com> wrote in
Show quoteHide quote
news:D422EDEB-18E9-442E-A46F-C15681103DDB@microsoft.com:

> How do I detect when an ActiveX control in a form is part of an Array
> of controls automátically?
>
> For example, in a form I can have one commando button an two
> textboxes:
>
> Command1
> Text1(0)
> Text1(1)
>
> If I use IsArray instruction I get false in both. Command1 doesn't
> have the Count property butText 1 does.
>
> If I test for the count property on Command1, I get an Error.
> Should I test the error Message?
>
> Rick

Test for Text1.Index ? and trap errors as necessary ?
Author
20 Mar 2009 4:12 PM
Dave O.
"Rick" <R***@discussions.microsoft.com> wrote in message
news:D422EDEB-18E9-442E-A46F-C15681103DDB@microsoft.com...

> For example, in a form I can have one commando button an two textboxes:

Ooh, is a commando button one that shoots back at you? :-)
Author
20 Mar 2009 6:49 PM
Jeff Johnson
"Dave O." <nob***@nowhere.com> wrote in message
news:eoiGKbXqJHA.4516@TK2MSFTNGP02.phx.gbl...

>> For example, in a form I can have one commando button an two textboxes:
>
> Ooh, is a commando button one that shoots back at you? :-)

"Get down!"

"Follow me if you want to live!"

"Get your ass to Mars."
Author
20 Mar 2009 8:14 PM
Jeremiah D. Seitz
On Fri, 20 Mar 2009 16:12:34 -0000, "Dave O." <nob***@nowhere.com>
wrote:

>Ooh, is a commando button one that shoots back at you? :-)

No. It's a button that dislikes confinement. :)

    J.
    Jeremiah D. Seitz
    Omega Techware
    http://www.omegatechware.net
Author
20 Mar 2009 4:17 PM
Nobody
Show quote Hide quote
"Rick" <R***@discussions.microsoft.com> wrote in message
news:D422EDEB-18E9-442E-A46F-C15681103DDB@microsoft.com...
> How do I detect when an ActiveX control in a form is part of an Array of
> controls automátically?
>
> For example, in a form I can have one commando button an two textboxes:
>
> Command1
> Text1(0)
> Text1(1)
>
> If I use IsArray instruction I get false in both. Command1 doesn't have
> the
> Count property butText 1 does.
>
> If I test for the count property on Command1, I get an Error.
> Should I test the error Message?

Search for IsControlArray() in Goggle groups.
Author
20 Mar 2009 4:34 PM
Galen Somerville
Show quote Hide quote
"Nobody" <nob***@nobody.com> wrote in message
news:e2zIfdXqJHA.5280@TK2MSFTNGP02.phx.gbl...
> "Rick" <R***@discussions.microsoft.com> wrote in message
> news:D422EDEB-18E9-442E-A46F-C15681103DDB@microsoft.com...
>> How do I detect when an ActiveX control in a form is part of an Array of
>> controls automátically?
>>
>> For example, in a form I can have one commando button an two textboxes:
>>
>> Command1
>> Text1(0)
>> Text1(1)
>>
>> If I use IsArray instruction I get false in both. Command1 doesn't have the
>> Count property butText 1 does.
>>
>> If I test for the count property on Command1, I get an Error.
>> Should I test the error Message?
>
> Search for IsControlArray() in Goggle groups.
>
>
Does this mean Google groups but you have to wear goggles?

Galen
Author
20 Mar 2009 6:42 PM
Bob Butler
Show quote Hide quote
"Galen Somerville" <galen@community.nospam> wrote in message
news:ejbkJnXqJHA.5832@TK2MSFTNGP06.phx.gbl...
>
> "Nobody" <nob***@nobody.com> wrote in message
> news:e2zIfdXqJHA.5280@TK2MSFTNGP02.phx.gbl...
>> "Rick" <R***@discussions.microsoft.com> wrote in message
>> news:D422EDEB-18E9-442E-A46F-C15681103DDB@microsoft.com...
>>> How do I detect when an ActiveX control in a form is part of an Array of
>>> controls automátically?
>>>
>>> For example, in a form I can have one commando button an two textboxes:
>>>
>>> Command1
>>> Text1(0)
>>> Text1(1)
>>>
>>> If I use IsArray instruction I get false in both. Command1 doesn't have
>>> the
>>> Count property butText 1 does.
>>>
>>> If I test for the count property on Command1, I get an Error.
>>> Should I test the error Message?
>>
>> Search for IsControlArray() in Goggle groups.
>>
>>
> Does this mean Google groups but you have to wear goggles?

Do commandos wear goggles?
Author
20 Mar 2009 6:49 PM
Jeff Johnson
"Bob Butler" <noway@nospam.ever> wrote in message
news:%23r2tYvYqJHA.1736@TK2MSFTNGP04.phx.gbl...

>>> Search for IsControlArray() in Goggle groups.
>>>
>>>
>> Does this mean Google groups but you have to wear goggles?
>
> Do commandos wear goggles?

Yes, but they do nothing.
Author
20 Mar 2009 8:15 PM
Jeremiah D. Seitz
On Fri, 20 Mar 2009 14:49:50 -0400, "Jeff Johnson" <i.get@enough.spam>
wrote:

>Yes, but they do nothing.

Is there something in the air today? Good to see some humor here
again!

    J.
    Jeremiah D. Seitz
    Omega Techware
    http://www.omegatechware.net
Author
20 Mar 2009 10:17 PM
Henning
Show quote Hide quote
"Jeremiah D. Seitz" <jse***@omegatechware.net> skrev i meddelandet
news:cau7s4tdaep14ah5mh7b929773cojvphkg@4ax.com...
> On Fri, 20 Mar 2009 14:49:50 -0400, "Jeff Johnson" <i.get@enough.spam>
> wrote:
>
>>Yes, but they do nothing.
>
> Is there something in the air today? Good to see some humor here
> again!
>
> J.
>    Jeremiah D. Seitz
>    Omega Techware
>    http://www.omegatechware.net

Yepp, they are about to get winter in Aus....

/Henning
Author
21 Mar 2009 5:53 AM
Jeremiah D. Seitz
On Fri, 20 Mar 2009 23:17:28 +0100, "Henning"
<computer_h***@coldmail.com> wrote:

>Yepp, they are about to get winter in Aus....

Probably the first time I was rightfully glad to be in the US. Spring
here ... <ahhhh>

Enjoy whatever season it is where you are ... unless you're in
Australia. In that case, I've got a spare room, but it'll cost you a
few thousand lines of code. :)

>/Henning

    J.
    Jeremiah D. Seitz
    Omega Techware
    http://www.omegatechware.net
Author
21 Mar 2009 11:48 AM
Henning
"Jeremiah D. Seitz" <jse***@omegatechware.net> skrev i meddelandet
news:0sv8s450i0icfjp61i14uh7ore9feh3bu9@4ax.com...
> On Fri, 20 Mar 2009 23:17:28 +0100, "Henning"
> <computer_h***@coldmail.com> wrote:
>
>>Yepp, they are about to get winter in Aus....
>
> Probably the first time I was rightfully glad to be in the US. Spring
> here ... <ahhhh>
>
> Enjoy whatever season it is where you are ... unless you're in
> Australia. In that case, I've got a spare room, but it'll cost you a
> few thousand lines of code. :)

That seems sheep, and affordable. It is the cost to get there from Sweden
that say I cant use the offer. ;)

>
>>/Henning
>
> J.
>    Jeremiah D. Seitz
>    Omega Techware
>    http://www.omegatechware.net

/Henning
Author
20 Mar 2009 7:06 PM
Nobody
"Galen Somerville" <galen@community.nospam> wrote in message
news:ejbkJnXqJHA.5832@TK2MSFTNGP06.phx.gbl...
>
> "Nobody" <nob***@nobody.com> wrote in message
> news:e2zIfdXqJHA.5280@TK2MSFTNGP02.phx.gbl...
>
>> Search for IsControlArray() in Goggle groups.
>>
>>
> Does this mean Google groups but you have to wear goggles?
>
> Galen

Only if you use their toolbar or software:

http://www.theregister.co.uk/2006/09/03/google_eavesdropping_software/
Author
23 Mar 2009 5:38 AM
Rick Rothstein
> How do I detect when an ActiveX control in a form is part of an Array of
> controls automátically?
>
> For example, in a form I can have one commando button an two textboxes:
>
> Command1
> Text1(0)
> Text1(1)

This link should help you out...

http://www.codenewsgroups.net/group/microsoft.public.vb.general.discussion/topic5126.aspx

--
Rick (MVP - Excel)
Author
23 Mar 2009 5:48 AM
Rick Rothstein
Or this link...

http://vbnet.mvps.org/code/helpers/iscontrolinarray.htm

--
Rick (MVP - Excel)


Show quoteHide quote
"Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in message
news:u9hyJm3qJHA.5452@TK2MSFTNGP02.phx.gbl...
>> How do I detect when an ActiveX control in a form is part of an Array of
>> controls automátically?
>>
>> For example, in a form I can have one commando button an two textboxes:
>>
>> Command1
>> Text1(0)
>> Text1(1)
>
> This link should help you out...
>
> http://www.codenewsgroups.net/group/microsoft.public.vb.general.discussion/topic5126.aspx
>
> --
> Rick (MVP - Excel)
Author
24 Mar 2009 11:59 AM
Bill McCarthy
"Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in message
news:%23BD42r3qJHA.3648@TK2MSFTNGP05.phx.gbl...
> Or this link...
>
> http://vbnet.mvps.org/code/helpers/iscontrolinarray.htm
>


Strange to see the credits given to that solution:

http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/80c615877b21ee7e?dmode=source
Author
24 Mar 2009 2:24 PM
Rick Rothstein
"Bill McCarthy" <TPASoft.com Are Identity Thieves> wrote in message
news:el2UUiHrJHA.3864@TK2MSFTNGP02.phx.gbl...
>
> "Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in message
> news:%23BD42r3qJHA.3648@TK2MSFTNGP05.phx.gbl...
>> Or this link...
>>
>> http://vbnet.mvps.org/code/helpers/iscontrolinarray.htm
>>
> Strange to see the credits given to that solution:
>
> http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/80c615877b21ee7e?dmode=source

It may have stemmed from this thread which took place a month earlier than
the one you cited...

http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/390423abb6526b87/d85749736560dd0b?hl=en&q=group:microsoft.public.vb.general.discussion+author:rothstein

--
Rick (MVP - Excel)
Author
24 Mar 2009 3:49 PM
Larry Serflaten
"Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote
> It may have stemmed from this thread which took place a month earlier than
> the one you cited...
http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/390423abb6526b87/d85749736560dd0b?hl=en&q=group:microsoft.public.vb.general.discussion+author:rothstein


You guys can quibble over ownership of that TypeName method, I liked
Bob's solution.  But, here's a new one, (let's really screw with their heads....)

Function IsArrayMember(Obj As Variant) As Boolean
    IsArrayMember = (VarType(Obj) <> VarType(Controls(Obj.Name)))
End Function


;-)
LFS
Author
26 Mar 2009 11:49 PM
Bill McCarthy
Hi Rick,

Show quoteHide quote
"Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in message
news:Ocz75wIrJHA.5912@TK2MSFTNGP02.phx.gbl...
> "Bill McCarthy" <TPASoft.com Are Identity Thieves> wrote in message
> news:el2UUiHrJHA.3864@TK2MSFTNGP02.phx.gbl...
>>
>> "Rick Rothstein" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in message
>> news:%23BD42r3qJHA.3648@TK2MSFTNGP05.phx.gbl...
>>> Or this link...
>>>
>>> http://vbnet.mvps.org/code/helpers/iscontrolinarray.htm
>>>
>> Strange to see the credits given to that solution:
>>
>> http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/80c615877b21ee7e?dmode=source
>
> It may have stemmed from this thread which took place a month earlier than
> the one you cited...
>
> http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_thread/thread/390423abb6526b87/d85749736560dd0b?hl=en&q=group:microsoft.public.vb.general.discussion+author:rothstein
>


yes and in that you are shown your proposed method of iterating didn't work.
Then when you saw my answer a month later, after initially arguing it with
me, you then posted :
http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/80c615877b21ee7e?dmode=source

<quote>
My apologies (maybe I got thrown by the typo), but . . .

YOUR SOLUTION WORKS PERFECTLY.

Thank you. That's what I love about these news groups, there is always
someone out there who can provide an answer to a question. For some reason,
this particular question has always presented a blind spot to me. I thought
I looked into, and I thought didn't find a solution in, the Controls
collection back when I first ran into this particular problem. Obviously, I
missed it then and never thought to look at it again. Thanks again.
</quote>


I think you pretty clearly state you didn't find a solution, and as far as I
know mine was the first ever posted solution to that problem.  Hence the
attribution on Randy's site still seems quite puzzling ;)