If Statement

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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
 
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
 
Back
Top