domain functions not working with query

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")
 
M

Michel Walsh

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top