Math Not Working

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

The second line of this code isn't working...
I need Text136 and Text140 to add and then multiply by STax...
I'm only getting Text136*Stax
Any help appreciated.


=Dollars(IIf(Forms!Sales.SalesDetails.Form!Text136>0,
(Forms!Sales.SalesDetails.Form!Text136+Forms!Sales.SalesDetails.Form!Text140)*[STax],
Forms!Sales.SalesDetails.Form!Text136*[STax]))

Thanks
DS
 
That's what you've told it to do. If you want to multiply the sum of Text136
and Text140, then use the following code. If either Text136 OR Text140 is
greater than zero, then it adds Text136 to Text140, then multiplies the
result by STax.

=IIf(Forms!Sales.SalesDetails.Form!Text136>0 or
Forms!Sales.SalesDetails.Form!Text140>0,
(Forms!Sales.SalesDetails.Form!Text136+Forms!Sales.SalesDetails.Form!Text140)*[STax],
0)

But I have to ask, what is STax? Is it the name of a form control, or the
name of a table/query field?

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
(Currently in Japan)
 
Graham said:
That's what you've told it to do. If you want to multiply the sum of Text136
and Text140, then use the following code. If either Text136 OR Text140 is
greater than zero, then it adds Text136 to Text140, then multiplies the
result by STax.

=IIf(Forms!Sales.SalesDetails.Form!Text136>0 or
Forms!Sales.SalesDetails.Form!Text140>0,
(Forms!Sales.SalesDetails.Form!Text136+Forms!Sales.SalesDetails.Form!Text140)*[STax],
0)

But I have to ask, what is STax? Is it the name of a form control, or the
name of a table/query field?

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
(Currently in Japan)
---------------------------

The second line of this code isn't working...
I need Text136 and Text140 to add and then multiply by STax...
I'm only getting Text136*Stax
Any help appreciated.


=Dollars(IIf(Forms!Sales.SalesDetails.Form!Text136>0,
(Forms!Sales.SalesDetails.Form!Text136+Forms!Sales.SalesDetails.Form!Text140)*[STax],
Forms!Sales.SalesDetails.Form!Text136*[STax]))

Thanks
DS
Thanks Graham... STax is actually Sales Tax!
All is well now!
Once again Thank You!
DS
 
Back
Top