domain functions not working with query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I tried using DCount in a report referencing a query that had three linked
tables and some criteria filtering. The query shows results fine. When I
switched references to a table it worked fine, so I know my syntax is
correct. My thought is that it doesn't like the query. Are there some queries
you can't use domain functions on? For instance, this query has the Unique
Values property set to Yes. There is also a calculated field name that uses a
function of the same name (not referenced in the DCount). Is that a no-no?
Here is my syntax-pretty basic:
=DCount("StudentID","qryCountbyDONStudentsUnique")
 
Hi,


I don't think UNIQUE could be a problem. In Northwind:


? DCount("*", "[Customers and Suppliers by City]"), DMax("Orders.ShipName",
"Invoices")
120 Wolski Zajazd




where "[Customers and Suppliers by City]" is a UNION query (even harder on
the system than a SELECT DISTINCT), but I changed Invoices to get a
DISTINCT, and it continues to work. Something else, probably, creates your
problem, while using the SAVED query.

? DCount("*", "SELECT * FROM categories")

does NOT work. The second argument is not intended to get an ad hoc SQL
statement.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top