Results 1 to 4 of 4

Thread: Creating a collection

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    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.

  2. #2
    Junior Member
    Join Date
    Oct 1999
    Posts
    31

    Post

    '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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    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!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Brossard, Québec, Canada
    Posts
    241

    Post

    ...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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width