Using Dcount function based on an access parameter query

K

Kiltedkiwi

I want to use Dcount in an access report but it is based on an access
parameter query and doesn't work. Works fine in an non parameter query so
what do I need to do differently to get it to work in a parameter query?
 
J

John Spencer

Try declaring the parameter type.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
 
D

Duane Hookom

I don't believe it is possible to use a parameter query as the "domain" in a
DCount() function. What are you attempting to accomplish?

Is the "domain" the same as your report's record source? If so, you can
probably use a simple =Count() or =Sum().

You might also be able to replace the query name in your domain with
[RecordSource].
 
J

John Spencer

Probably bad advice on my part. I misunderstood what you are attempting to
do.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
K

Kiltedkiwi

Thank you for all your responses. Solved the problem by using the Sum(Abs)
function.

Duane Hookom said:
I don't believe it is possible to use a parameter query as the "domain" in a
DCount() function. What are you attempting to accomplish?

Is the "domain" the same as your report's record source? If so, you can
probably use a simple =Count() or =Sum().

You might also be able to replace the query name in your domain with
[RecordSource].

--
Duane Hookom
Microsoft Access MVP


Kiltedkiwi said:
I want to use Dcount in an access report but it is based on an access
parameter query and doesn't work. Works fine in an non parameter query so
what do I need to do differently to get it to work in a parameter query?
 

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