iif statement * subreport

Z

znibk

Hello to all of you, in the past you have been helpful in clearning up my
problems, so I hope you can clear this one up for me.

I have been asked to base my total expense report for the month on only the
checks which hae cleared the bank. I ave used these IIF statements which
say=sum([cleared],-1,[ckamt],0)) as my control source
=sum([cleared]="yes",[ckamt],0)

The subreport is totaling the expenses, however, it is not leaving out the
checks which have not cleared the bank. To accomplish that task, I added the
field [Cleared] with data type set to yes/no in the table, queries, etc.
However, as I stated above, the subreport is still calculating the subreort
based on all checks written during the month for expenses.

Can somone help me come up with the correct IIF statement, and what I should
do?

Thanks a bunch and God Bless all of you for the help you give me (us).
 
D

Duane Hookom

It's difficult to understand if this is a report or subreport. If you want to
sum the ckamt values in a report's record source with Cleared = true, try:
=Sum(Abs(Cleared) * [CkAmt])
This assume Cleared is yes/no and CkAmt is numeric.
 
Z

znibk

tkelley

Thank you so very much. I "knew that!" Sometimes I panic and when I do, I
forget everything I have ever known. Now all I have to do is go through and
correct all the mess I made.

Thank you again so much for reminding me and God Bless you.

tkelley via AccessMonster.com said:
May I ask why you don't just add the criteria of [Cleared] = -1 to your
report's underlying query? Why include the checks you don't want in the
underlying query, then add the overhead of trying to filter them out via IIf
functions?

I realize that may sound simple ... so I may have missed something in your
question. If so, please explain a little more.
Hello to all of you, in the past you have been helpful in clearning up my
problems, so I hope you can clear this one up for me.

I have been asked to base my total expense report for the month on only the
checks which hae cleared the bank. I ave used these IIF statements which
say=sum([cleared],-1,[ckamt],0)) as my control source
=sum([cleared]="yes",[ckamt],0)

The subreport is totaling the expenses, however, it is not leaving out the
checks which have not cleared the bank. To accomplish that task, I added the
field [Cleared] with data type set to yes/no in the table, queries, etc.
However, as I stated above, the subreport is still calculating the subreort
based on all checks written during the month for expenses.

Can somone help me come up with the correct IIF statement, and what I should
do?

Thanks a bunch and God Bless all of you for the help you give me (us).
 
Z

znibk

Duane,

Yes, [Cleared] is yes/no and [CkAmt] is numeric and I thank you so much for
replying, but tkelly reminded me of something I completely had forgotten made
life much more simple and that is to add to the criteria in my query of
[Cleared] = -1

Thank you again for replying and God Bless you.
k
Duane Hookom said:
It's difficult to understand if this is a report or subreport. If you want to
sum the ckamt values in a report's record source with Cleared = true, try:
=Sum(Abs(Cleared) * [CkAmt])
This assume Cleared is yes/no and CkAmt is numeric.

--
Duane Hookom
Microsoft Access MVP


znibk said:
Hello to all of you, in the past you have been helpful in clearning up my
problems, so I hope you can clear this one up for me.

I have been asked to base my total expense report for the month on only the
checks which hae cleared the bank. I ave used these IIF statements which
say=sum([cleared],-1,[ckamt],0)) as my control source
=sum([cleared]="yes",[ckamt],0)

The subreport is totaling the expenses, however, it is not leaving out the
checks which have not cleared the bank. To accomplish that task, I added the
field [Cleared] with data type set to yes/no in the table, queries, etc.
However, as I stated above, the subreport is still calculating the subreort
based on all checks written during the month for expenses.

Can somone help me come up with the correct IIF statement, and what I should
do?

Thanks a bunch and God Bless all of you for the help you give me (us).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top