Hi Please assist I have a field that stores Answer Yes and No as text as the field gets updated via other sources. I want to count the Yes answers. (1 Viewer)

RobertVerster

New member
Local time
Today, 08:03
Joined
Apr 25, 2020
Messages
10
1587796397514.png
 

isladogs

MVP / VIP
Local time
Today, 07:03
Joined
Jan 14, 2017
Messages
18,255
Hi Robert
You posted to Sample databases which is a moderated area and not used for asking questions. I moved it to forms.

Its unclear from your post whether Answers is a text field or a Yes/No field.
If its text then you need to put quotes around Yes in your expression.
If its Yes/No, suggest you replace Yes with True in the expression and don't use quotes.

BUT is it a single or a continuous form?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:03
Joined
May 7, 2009
Messages
19,246
you need to have an unbound textbox on the form's footer:
=count(iif([answers]="yes", 1, null))

then you refer the unbound textbox on the detail section textbox:

=[unboundtexboxonfootername]
 

RobertVerster

New member
Local time
Today, 08:03
Joined
Apr 25, 2020
Messages
10
Hi Robert
You posted to Sample databases which is a moderated area and not used for asking questions. I moved it to forms.

Its unclear from your post whether Answers is a text field or a Yes/No field.
If its text then you need to put quotes around Yes in your expression.
If its Yes/No, suggest you replace Yes with True in the expression and don't use quotes.

BUT is it a single or a continuous form?

Hi its a single form The Hi Lighted fields is teh once that I need to use to count the Yes replyes
1587798673578.png
 

isladogs

MVP / VIP
Local time
Today, 07:03
Joined
Jan 14, 2017
Messages
18,255
Robert
The new screenshot definitely won't work.
You didn't respond to all my points.
Did you try my suggestions or those of @arnelgp?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:03
Joined
May 7, 2009
Messages
19,246
sorry, you can put it directly into the unbound textbox:

=Count(Iif([Answers] = "Yes", 1, Null))
 

RobertVerster

New member
Local time
Today, 08:03
Joined
Apr 25, 2020
Messages
10
Hi I would like to count the Answer Yes in the sub for and display the count in the Top/Header Form.
1587804593399.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:03
Joined
May 7, 2009
Messages
19,246
add an Unbound Textbox (txtTotalYes) to the Form's header section.
on its ControlSource, put:

=DCount("1", "CovidFormSubQuestionsQry", "InspectionNumber=" & [InspectionNumber] & " And Answers='Yes'")
 

RobertVerster

New member
Local time
Today, 08:03
Joined
Apr 25, 2020
Messages
10
Thanks I did get your reply. I did it and then open the form the field like just flickers with a error message inside.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:03
Joined
May 7, 2009
Messages
19,246
you replace "CovidFormSubQuestionsQry" with the Query name you are using for the subform.
 

Users who are viewing this thread

Top Bottom