Silroc
Silroc

Reputation: 45

Access report showing #Name? in text box bound to query result

I have a table (named Responses) with a field named q01 which contains numbers from 1 to 5. All entries contain valid numbers.

I created a query named query11 which counts the number of entries in Responses with a number 1 in q01. (Two columns in the query. First has Field: q01, Table: Responses, Total:Expression, Criteria: 1, Show is unchecked. Second has Field: Count_1_1:q01, Table:Responses, Total:Count, show is checked.) This shows the correct count when the query is run.

I created a report named rpt_General which contains a text box (named txtQuery1-1) with the control source =[query11]![Count_1_1]

Any time this is run it displays #Name? in the text box. I have done some research and seen a number of references to the name of the text box being duplicated elsewhere, but I have changed it numerous times, deleted and recreated the report, and still cannot get it to display correctly.

Upvotes: 2

Views: 1529

Answers (1)

Silroc
Silroc

Reputation: 45

Thanks to both HansUp and LiamH, I was able to get this working by substituting this as the text box's Control Source.

=DCount("*","[Responses]","q01=1")

Also, I had not added query11 into the report's record source.

Upvotes: 1

Related Questions