#Error message

I

IowaHawkeye

My problem is this. I am trying to create a field that counts the number of
"Yes" responses in a text field. I enter the following in the Control Source
of a text box that I place on my form:
=DCount("[TipsandTricks]","[ConfinedSpace]","Yes"). When I complete the
entry, I receive an #Error result in the text box I created to calculate the
number of "Yes" entries. What am I doing wrong?
 
A

Allen Browne

You could try:
=DCount("*", "[ConfinedSpace]" ,"[TipsandTricks] = True")

But this may be quicker:
= - DSum("TipsandTricks", "[ConfinedSpace]")
 
B

Beetle

If [TipsandTricks] is the field with the Yes/No value and
[ConfinedSpace] is the table/query, then it should be;

=DCount("[TipsandTricks]","[ConfinedSpace]","[TipsandTricks] = 'Yes'")

Another option might be;

=Sum(Iif([TipsandTricks] = 'Yes', 1, 0))
 

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

Similar Threads


Top