Results 1 to 2 of 2
  1. #1
    Ellpee is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Posts
    80

    Function to Pass Multiple Values as Array

    First time trying to do this, works correctly within the function but when passed upward to the calling procedure, not so much.

    Function itself is declared as a Variant
    Within the function, I Dim intCounts(3) as a Variant, scroll through a recordset and increment the three elements of the array; end result is three integers stored in the array, e.g., 0, 201, 51
    Return value of function is then set to intCounts(3)

    But back at the calling procedure,
    intEndCounts(3) has been declared as a Variant, but


    setting intEndCounts(3) = the function's return value gives me 0, 0, 0

    Obviously I'm missing something despite considerable Googling. Any help out there? If this general description isn't adequate I'll post a bare-bones version of the actual code.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Review the Similar threads at the bottom of this thread -specifically Function that returns an array by Lefty2cox. See if it does what you need.

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

Similar Threads

  1. Passing dynamic name of array to a Function
    By mcarval22 in forum Programming
    Replies: 41
    Last Post: 07-29-2016, 04:53 PM
  2. Function that returns an array
    By lefty2cox in forum Programming
    Replies: 6
    Last Post: 03-03-2016, 04:34 PM
  3. st deviation function on array
    By registoni in forum Programming
    Replies: 2
    Last Post: 09-09-2013, 04:00 AM
  4. Having Trouble Returning Array from Function
    By NigelS in forum Programming
    Replies: 8
    Last Post: 08-15-2011, 07:12 AM
  5. INNER JOIN to a split(array) function?
    By kman42 in forum Queries
    Replies: 8
    Last Post: 05-09-2011, 01:53 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