If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

creating arrays of objects (textboxes)

Hi all!
I'm new to vb and expecially ado. I've made a connection to the database
(access) and built a couple of forms that put data in the database and I
can search through the data base and populate the recieving forms (objects),
BUT IT'S SUCH A PAIN IN THE ***!! I have if this and if that ...(controls^(n-1))times.
So what I want to do is create an array of controls (text boxes in particular)
so I can loop through a procedure or function with the array and perform
whatever on the data.
I've tried Dim thesetexts as controls(5)
, Dim thesetexts as textboxes(5) etc.........
NO LUCK ! I'm pretty comfortable with objects and have an understanding
of object programming (C++) but, like I said I'm new to VB so.......? Any
Help (including criticism) welcome..
New to the sight, so if I'm in the wrong place, Please disregard.
Peace!

Re: creating arrays of objects (textboxes)

Simply set the Index property of the textbox to 0, then create another
textbox with the same name and set its Index to some other number. That
will create an array of textboxes.

--
Robert Gelb

"zoes" <wilscott@earthlink.net> wrote in message
news:3925c6c0$1@news.devx.com...
>
> Hi all!
> I'm new to vb and expecially ado. I've made a connection to the
database
> (access) and built a couple of forms that put data in the database and I
> can search through the data base and populate the recieving forms
(objects),
> BUT IT'S SUCH A PAIN IN THE ***!! I have if this and if that
....(controls^(n-1))times.
> So what I want to do is create an array of controls (text boxes in
particular)
> so I can loop through a procedure or function with the array and perform
> whatever on the data.
> I've tried Dim thesetexts as controls(5)
> , Dim thesetexts as textboxes(5) etc.........
> NO LUCK ! I'm pretty comfortable with objects and have an understanding
> of object programming (C++) but, like I said I'm new to VB so.......? Any
> Help (including criticism) welcome..
> New to the sight, so if I'm in the wrong place, Please disregard.
> Peace!