Results 1 to 4 of 4
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Thumbs up Loop through numbered variables

    How do I put an array into an array?

    I have a custom class object, but lets just call it XYZ

    so I want to do a for loop and add an array from a function

    for x = 0 to 4 (as there will be 4)

    arrayHoldArray(x) = makearrayFunc(x)



    next x


    I am not sure how to access the child array within the array

    arrayholdarray(x) is not going to produce an array for me to use

    so for exampe myArray = arrayholdarray(x)

    or is it?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,515
    Again, arrays are obsolete. VB uses collections, these are indexed and dont need to be 'looped' thru to get things.

    set col = new collection
    col.Add arrayholdarray,sKey

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by ranman256 View Post
    Again, arrays are obsolete. VB uses collections, these are indexed and dont need to be 'looped' thru to get things.

    set col = new collection
    col.Add arrayholdarray,sKey
    Ok, only I do need to loop through to find matches and/or add remove based on those...

    I am autogenerating a list that removes duplicates of the class object - I want to remove duplicates of the class and not the elements within the class....

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,515
    In the collection...
    col.add classObj, keyname

    To remove...
    col.remove keyname

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 05-08-2015, 02:36 PM
  2. Sequentially Numbered Column
    By DMullane in forum Access
    Replies: 1
    Last Post: 12-09-2014, 01:50 PM
  3. Replies: 4
    Last Post: 11-10-2011, 03:26 PM
  4. Replies: 4
    Last Post: 08-31-2011, 12:36 PM
  5. A column numbered: 1,2,3,4,5...
    By eezing in forum Queries
    Replies: 1
    Last Post: 08-18-2009, 09:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums