-
Hi. I have a small problem about creating a collection.
I sure know how to loop through all controls of a collection (for each ctl in form.controls). The problem is I would like to CREATE such a collection myself. (Ex.: I will add to a collection all the textboxes that the user have modified).
Afterward, I would to refer to this control. I'm not how could this be done.
Thanks for the help.
-
'Declare a collection
Dim something as New Collection
'Add the modified textbox in the collection
something.Add txtMyName
'Loop through the collection using For Each..Next
-
I already tried this. This code will add the VALUE of txtMyName to the collection.
Looping with For Each...Next through the collection won't allow me to refer to this control. Am I right?
I would like to loop through that collection and change the .value of these controls to something I will decide. Or let's just say I want to loop and set the collection's controls to .visible = false. How could I make such a reference?
Thanks!
-
...I tried to dim some variables AS CONTROL. And I thought I could do something like ctlMyControl.name = "txtControlName" but that property doesn't exist for such a new dimmed variable.
Still in need of any comments. Thanks.