count of txt boxes that have a greater value than 0

shutzy

Registered User.
Local time
Today, 00:14
Joined
Sep 14, 2011
Messages
775
i have a report and at the footer i want to show how many of the txt boxes i have are >0

i tried

=Count([txtbox]>0)

i know that this is quite simple but i just cant get it

thanks
 
=Sum(IIf([txtbox] > 0, 1, 0))
 
thanks for your reply. i tried your expression and when i open the report i get

'Enter parameter value'
txt box

i i dont input anything into the box i get a zero in the txt box that has the SUM expression.

any ideas?
 
What is the exactly name of the text box you try to sum, is it "txtbox", "txt box" or ...?
 
So did you try with that name? I copied what you posted.

And you'd probably want a field name rather than a textbox name, but it may work.
 
hi, yes i did try it with the correct txt box name. ive just tried it again and i get the same error. does it matter where on the report i put it?

i did initially think that it was down to me using a DCount in a text box. so i moved the dcount to the report record source
 
If you didn't got it, post a stripped version of you database with some sample data.
 
ive attached the report needed and the tables that are required.

if you open the report you will see what i mean.

cant believe i had to zip the file to get it to upload. theres only 3 tbls and one report and it was > 2mb.
 

Attachments

You can't sum a calculated control, so you can move that calculation to the query the report is based on, use the Running Sum property of another textbox, or:

=Sum(IIf(DCount("[OrderID]","[tblOrders]","[ClientDetailsID]= " & [ClientDetailsID] & " and [Status] =3 and [OrderDate]<Date()")>0,1,0))
 

Users who are viewing this thread

Back
Top Bottom