Hmmm... okay, some background.
The query is enormous, not a lot of rows but many, many columns. Basically we have 9 applicable buildings around the country and each building has a value. i want to know first of all if any value at a building exceeds a target number. If it does, great, stop there (and i've completed this portion of the query). If not, i want to know if the sum of the values at any two buildings exceeds the target, and if so, i want to find the closest pair of buildings that exceed the target (combined) geographically.
i've established each pairing into 37 different combinations i'm calling Duo1, Duo2, Duo3, etc. Now i need to cycle through these to determine if any Duo is >= the target, and if so, identify which of the Duos is first (the 1, 2, 3, etc pairings are geographically arranged already). Rather than stack 37 IIf statements, i'd prefer to call a function that sets up the duos as an array and does the comparison there, and then returns the Duo. i have a Select Case that would work already, or i could make it a 2-dimensional array, one with the field name and one with the field value. Either is fine, but Access won't let me call the function passing that many fields.
Perhaps a lookup could work? Not sure how to specify which row in the query to look up though, since that's irrelevant as far as the function at large is concerned (it's going to run through the function once for every row).