Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    array data types (97)

    array data types
    when defining an array meant to store a series of control names what would be the best way to store the names? I

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: array data types (97)

    Since you're storing the names of the controls, a string is more efficient than using a variant. Arrays can hold custom user-defined types, though, and those can hold an object.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: array data types (97)

    conceivably then if you store a string in an array index, couldn

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: array data types (97)

    Frankly, I'm not sure what you're trying to do in that expresion. The array reference will certainly return the name of the member of a form's controls collection, but I don't understand why you're doing it that particular way, using the Form_NewDataEntry.Controls syntax instead of Forms!NewDataEntry.Controls.
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: array data types (97)

    I

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: array data types (97)

    You would be advised to pass the form object itself as an argument into the code routine if you want to deal with the form's controls collection. That gives you the additional advantage of not having to hard code a reference to a specific form into the code.

    I don't know what you mean about accessing your string array. Is the array being passed into the code routine as well? Where does the array live and what are you trying to do with it? It looks to me like all you're trying to do is retrieve the name of the control to use as an index into the controls collection of the form, but you could just as easily loop through the controls collection of the form object using the For Each ... Next syntax without using an array at all. If you explain what you're trying to accomplish, I'm sure you'll get more useful answers.
    Charlotte

Posting Permissions

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