Sumiif Function in Report's Text Box's Control Source Property

JithuAccess

Member
Local time
Today, 09:41
Joined
Mar 3, 2020
Messages
325
Hello,

I have three fields in my Table: ID, Status and Amount. I want to find the sum of the Amount if the Status is "Approved" in my report. What would be the Syntax if I am using the "Sumiif" Function?

I have put the following Function in the Text Box's control source property of my Report

=Sum([Amount](IIf([Status]="Approved",0)))

And I am getting an Error message like "Undefined function 'Amount' in Expression". Could you please help me how to solve this.

Thanks
 
Maybe try something like:

Code:
=Sum(IIf([Status]="Approved",[Amount],0))
 
Maybe try something like:

Code:
=Sum(IIf([Status]="Approved",[Amount],0))
Thanks a lot for your reply. But unfortunately, it is showing as $0.00.


Thanks
 
you can also use DSum() function as Control Source of the textbox:

=DSum("Amount", "yourTableName", "Status = 'Approved'")
 
Let us know what happens...
I guess I solved it. Thanks a lot for your Help.

This is my Table:

1606146877850.png


This is my Report:

1606147121773.png


And this is the Result:

1606147176433.png


Thanks a lot for your help. And sorry for the late reply.

Thanks
 
Hi. Glad to hear you got it to work. Good luck with your project.
Thanks a lot. It saved lot of time and effort. I used to create a query to find the sum and then create a sub report to bring that result in to my main Report.

Thanks
 

Users who are viewing this thread

Back
Top Bottom