If Statement

G

Guest

I am entering the following if statement:
=IIf(Sum([Text98])-Sum([Text99])>0,Sum([Text98])-Sum([Text99]),"")
Basically, I have text100 text box on my report that is the following formula:
=Val([Text98]-[Text99])
If this total is less than 0 is should go in credit and if
it is more than 0 is should go in debit.
My problem with the statement is that I am prompted for a parameter value
for Text98 and one for Text99 when I try to run my report.
Thanks
Jeannie
 
D

Duane Hookom

These controls would all need to be in the same section of the report.

BTW: Do yourself a favor and rename your text boxes. "Text98" isn't very
descriptive which would make maintenance and updates very difficult.
 
G

Guest

All the controls are in the report footer.
I have changed by if statement for:
=IIf(Sum([BillingGST])-Sum([BillingQST])>0,Sum([BillingGST])-Sum([BillingQST]),"")
BillingGST used to be Text98
BillingQST used to be Text99
I get the same result where I am prompted for a parameter value for
BillingGST and one for BillingQST when I run the report.
Thanks Duane for your help, any suggestions
Jeannie

Duane Hookom said:
These controls would all need to be in the same section of the report.

BTW: Do yourself a favor and rename your text boxes. "Text98" isn't very
descriptive which would make maintenance and updates very difficult.

--
Duane Hookom
MS Access MVP
--

Jeannie said:
I am entering the following if statement:
=IIf(Sum([Text98])-Sum([Text99])>0,Sum([Text98])-Sum([Text99]),"")
Basically, I have text100 text box on my report that is the following
formula:
=Val([Text98]-[Text99])
If this total is less than 0 is should go in credit and if
it is more than 0 is should go in debit.
My problem with the statement is that I am prompted for a parameter value
for Text98 and one for Text99 when I try to run my report.
Thanks
Jeannie
 
D

Duane Hookom

You can't sum a control. You can sum an expression based on a field from the
report's record source.

--
Duane Hookom
MS Access MVP


Jeannie said:
All the controls are in the report footer.
I have changed by if statement for:
=IIf(Sum([BillingGST])-Sum([BillingQST])>0,Sum([BillingGST])-Sum([BillingQST
]),"")
BillingGST used to be Text98
BillingQST used to be Text99
I get the same result where I am prompted for a parameter value for
BillingGST and one for BillingQST when I run the report.
Thanks Duane for your help, any suggestions
Jeannie

Duane Hookom said:
These controls would all need to be in the same section of the report.

BTW: Do yourself a favor and rename your text boxes. "Text98" isn't very
descriptive which would make maintenance and updates very difficult.

--
Duane Hookom
MS Access MVP
--

Jeannie said:
I am entering the following if statement:
=IIf(Sum([Text98])-Sum([Text99])>0,Sum([Text98])-Sum([Text99]),"")
Basically, I have text100 text box on my report that is the following
formula:
=Val([Text98]-[Text99])
If this total is less than 0 is should go in credit and if
it is more than 0 is should go in debit.
My problem with the statement is that I am prompted for a parameter value
for Text98 and one for Text99 when I try to run my report.
Thanks
Jeannie
 
G

Guest

I know it sounds kinda dumb but are you staying consistent with the spelling?
It sounds like it doesn't know what BillingGST is so there for it is asking
you for a parmeter.
sks


Duane Hookom said:
You can't sum a control. You can sum an expression based on a field from the
report's record source.

--
Duane Hookom
MS Access MVP


Jeannie said:
All the controls are in the report footer.
I have changed by if statement for:
=IIf(Sum([BillingGST])-Sum([BillingQST])>0,Sum([BillingGST])-Sum([BillingQST
]),"")
BillingGST used to be Text98
BillingQST used to be Text99
I get the same result where I am prompted for a parameter value for
BillingGST and one for BillingQST when I run the report.
Thanks Duane for your help, any suggestions
Jeannie

Duane Hookom said:
These controls would all need to be in the same section of the report.

BTW: Do yourself a favor and rename your text boxes. "Text98" isn't very
descriptive which would make maintenance and updates very difficult.

--
Duane Hookom
MS Access MVP
--

I am entering the following if statement:
=IIf(Sum([Text98])-Sum([Text99])>0,Sum([Text98])-Sum([Text99]),"")
Basically, I have text100 text box on my report that is the following
formula:
=Val([Text98]-[Text99])
If this total is less than 0 is should go in credit and if
it is more than 0 is should go in debit.
My problem with the statement is that I am prompted for a parameter value
for Text98 and one for Text99 when I try to run my report.
Thanks
Jeannie
 

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

Similar Threads

Conditional sum 5
Round up number 2
Is that your Final Answer????? 13
Two IIF statements possible? 4
Iif statement and secondary evaluation criteria 1
summing a text box 1
SumIf on report 2
Using iif Null and 0 5

Top