counting

loki

Registered User.
Local time
Today, 07:31
Joined
May 4, 2001
Messages
58
I have an unbound textbox called "response" in my details section on my report inwhich I did some calculation in the format details section which gave me values of yes and no displayed in the textbox. I want to count the yeses and no, and put that value in the footer. I tried Count([response]) but it won't work. Can any one help?
 
Have a hidden text box named TheYes whose control source is:
=iif([response],1,0)

Another named TheNo whose control source is:
=iif([response],0,1)

Then, in the footer have two text boxes with:
=Sum([TheYes]) and
=Sum([TheNo]), respectively

HTH
 
This solution did not work because it does not recognize what theyes and theno is. Does anyone have any other ideas
 
loki,

try this...
------

Have a hidden text box named TheYes whose control source is:
=sum(iif([response],1,0))

Another named TheNo whose control source is:
=sum(iif([response],0,1))

Then, in the footer have two text boxes with:
=[TheYes] and
=[TheNo], respectively

-----
(i'm assuming that [response] is a boolean field)

hth,
al
 
Thanks for these solutions, but they are still not working. Because of [response] being an unbound textbox, it does not recognize [response] when I try to sum or count it. I desperately need help.
 
As I recall I've answered this one before and the suggestion I came up with was:

Have two fields which do the same thing, one of them your visible response field and another which is hidden which has the same expression as your response field BUT set the running sum to yes.

In the footer for the group enter this code:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Me.CodeSum = Me.Text22
End Sub

Me.Text22 is the hidden summing field and Me.CodeSum is the field in the footer which holds the total sum of Yes/No's.

Ian

[This message has been edited by Fornatian (edited 07-09-2001).]
 
-Fornatian
I tried this and the first part is OK but nothing is appearing in my footer. As far as the running sum property is concerned, there was no yes to pick from, just "Over Group" and "Over All". I tried both and still nothing. Do you have any other ideas?
 
Check your hotmail a/c and you may find a dbase that may help you a little.

Ian
 

Users who are viewing this thread

Back
Top Bottom