I cannot see how a domain function is the route when these queries are getting executed tens of thousands of times, against recordsets of around 10k records. Are in around 30 different locations (the callers I mean). Maybe an idea to submit a request to site development to remove the like button@dalski Although likes are nice they are not helpful. Please tell people if my last response solved your problem and you are going to switch to domain functions. OR, you're going to remove the repeating group.

In my amateur perception it just seems so inefficient to create a query for each individual field one wants returned & that's what led me to this thread. It's looking up an ID & returning one of several fields I need dependant on where it is executed from.Not possible.
Exactly right, I'm trying to replicate your masterful Treeview, but with a Subform. Trying to avoid recursion by using structured logic with SQL.Are you returning one record with lots of fields. If so a type can make things a lot easier to read and manage
Code:Type ResourceRecord Description As String BuyRate As Currency DiscountPercent As Double ResourceType As String UnitUse As String End Type [/QUOTE]
1 - I'm using a class, & class composition (sub-classes) to replicate what is being read on the current record of the subform in-lieu of your type e.g. I know we don't have inheritance in VBA but I'm replicating from some of your awesome tutorials & much reading/ experimenting. So that seems reasonable for a single record & gives me the benefit of encapsulation to reduce complexity.
2 - So that's fine for the single record being read in the Subform & the classes provide methods for sorting & adding records... But to maximise speed I'm using queries to lookup the headers... instead of your recursion.
Last edited: