If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Error message
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? |
#2
|
|||
|
|||
#Error message
You could try:
=DCount("*", "[ConfinedSpace]" ,"[TipsandTricks] = True") But this may be quicker: = - DSum("TipsandTricks", "[ConfinedSpace]") -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "IowaHawkeye" wrote in message ... 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? |
#3
|
|||
|
|||
#Error message
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)) -- _________ Sean Bailey "IowaHawkeye" wrote: 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? |
Thread Tools | |
Display Modes | |
|
|