Okay, this gets asked reasonably often, so here is a new article: ECount() - an extended DCount() at: http://allenbrowne.com/ser-66.html
ECount() takes the same arguments as DCount(), but an extra flag you can set to retrieve the distinct count.
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org.
"EmBee" <usenetNOT_THIS[ at ]MargaretBartley.com> wrote in message news:eFbK4akwGHA.1624[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] > If I were using the UI, I would create a Totals query to find the number > of > unique values in a field, but I want to put that number into a variable in > my code. Is there any way to do that using a Domain Aggregate function, > or > do I have to create a recordset based on a Totals query, and open the > recordset and read the first record?
|