2
votes

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.

1
Is query11 included in the report's Record Source? If not, try this as the text box's Control Source: =Dlookup("[Count_1_1]", "query11")HansUp
You don't need a query as far as im aware... =dcount("*", "[Responses]","q01=1")LiamH
Both of these were great. I had forgotten to include the query in the record source, and I also simplified it by doing away with the query and using DCount. Thanks to both of you!Silroc

1 Answers

1
votes

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.