Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dcount in Rpt based on query with parameter input

Status
Not open for further replies.

owg

IS-IT--Management
Jun 20, 2001
3
US
I have a simple one page report based on a select query with one criteria based on one table; it results with "#Error".
I have reproduced the same problem in the following simple example:
Table1 with record ID and city names:
1 Chicago
2 Chicago
3 Lyons
Table1Query:
Selects records using hardcoded criteria "chicago"
Table1Report:
counts the records in the Table1Query domain using
DCount("[ID]","Table1Query")
THIS WORKS, producing a reported count of 2

THE PROBLEM OCCURS when...
In order to make the production of the report simpler I change the critera in the query to an input parameter, ie., [Enter City Name]. Responging to the input parameter with "chicago", the stand-alone query produces the same record count, "2", as when it was hardcoded, but now the report only returns "#Error" where DCount(....) was used.

I have read in other Access TekTips where field names cannot be the same as the underlying source table/query field name. The name of the field in the report is Text5. Of course, the name of the field is ID in both the Table and the Query.

Any thoughts?
 
My reply in this thread works in your situation is well.

DMax formula in Report Header
thread703-115056 Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top