Full Version: Parameter and DCOUNT Issue?
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
gym_jtm
Hi --

I have a query with a Parameter set up in the query CRITERIA field for date range ... i.e."Between [Enter FROM Date] and [Enter TO Date]" ...

The query itself and some of my reports have output based on the ranges ... but my reports that contain a DCOUNT formula return a #error in the fields that have the DCOUNT formula.

If, instead, I removed the parameter from the CRITERIA field and instead place a date range like "between #9/1/2006# and #9/30/2006#" the DCOUNT fields in the reort will work.

How can I get this report to populate appropriately with an existing parameter?
jmcwk
How are you currently entering you data for the Parameter/s?
gym_jtm
The parameter is in the query itself, in the CRITERIA section.

The syntax in the CRITERIA field is as follows: Between [Enter FROM Date] And [Enter TO Date]

... When the parameter box opens, I just key in the date in a mm/dd/yyyy format.

I hope that helps!
jmcwk
hmmmmm.... not real sure why it works for you one way and not the other. Have you tried using a form for your From and To Date/s? And then use :



>=[forms]![theNewformnamehere]![txtDateFrom] And <=[forms]![theNewformnamehere]![txtDateTo]

txtDateFrom being your From Control (unbound)
txtDateTo being your To Control (unbound)

Then a command button to open the report

This of course would go in the Criteria line of the Date Field you are using for you report.

>=[forms]![theNewformnamehere]![txtDateFrom] And <=[forms]![theNewformnamehere]![txtDateTo]

What is the Syntax of your Dcount?


Edited by: jmcwk on Fri Oct 20 18:24:46 EDT 2006.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.