The enclosed functions are replacements for the Domain Aggregate
functions such as DLookup() and DSum().  I created them because of
the spped problems in the Domain functions, and because there are
several forms in my DB that require calculations such as these from
several different tables. Essentially they mimic the Domain functions
except that you pass a Recordset variable instead of a table or query.

In testing these I found them to be about four to five times faster
than the domain functions.  This included the time necessary to
generate the recordest with a select statement to filter only records
that I was interested in (only those receipts for a single individual
for example).

This speed advantage held up even on moderate size lookup tables when I
just opened the entire table as a recordset.

The declarations are all pretty self explanitory, and with two exceptions,
all the functions return a NULL value on error.  The two exceptions are
rsCount() which will return a zero value, and rsFindMatch() which will
return a false if no matching records are found or if there is an error.

rsFindMatch() only exists to test wether a null value returned from
rsLookup (or any of the other functions) represents a real value or an
error.

Anyhow, please feel free to use and distribute these functions if you
haven't already created your own functions with the same functionality.
Any comments or suggestions are welcome, as this is just my first attempt
to give a little back for all the help I've gotten from this forum.

Peter Stambaugh
73174,451

