Calculating the value of two fields in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to calculate the product of two controls in a report but do not want
the product to exceed the number 40. In all cases where the number 40 is
exceeded, the maximum value returned must be 40. Any help is appreciated.
 
Rick,

Thanks for the response. I typed the expression exactly as you suggested but
Access returned the error "Syntax error; comma in query expression." What did
I do wrong?
--
Michael


Rick B said:
If([Field1]*[Field2]>40, 40, [Field1]*[Field2])



--
Rick B



Michael_100 said:
I need to calculate the product of two controls in a report but do not want
the product to exceed the number 40. In all cases where the number 40 is
exceeded, the maximum value returned must be 40. Any help is appreciated.
 
Rick B normally gets these things correct the first time. The control source
should be

=IIf([Field1]*[Field2]>40, 40, [Field1]*[Field2])

--
Duane Hookom
MS Access MVP
--

Michael_100 said:
Rick,

Thanks for the response. I typed the expression exactly as you suggested
but
Access returned the error "Syntax error; comma in query expression." What
did
I do wrong?
--
Michael


Rick B said:
If([Field1]*[Field2]>40, 40, [Field1]*[Field2])



--
Rick B



Michael_100 said:
I need to calculate the product of two controls in a report but do not
want
the product to exceed the number 40. In all cases where the number 40
is
exceeded, the maximum value returned must be 40. Any help is
appreciated.
 
Thank you, both!
--
Michael


Duane Hookom said:
Rick B normally gets these things correct the first time. The control source
should be

=IIf([Field1]*[Field2]>40, 40, [Field1]*[Field2])

--
Duane Hookom
MS Access MVP
--

Michael_100 said:
Rick,

Thanks for the response. I typed the expression exactly as you suggested
but
Access returned the error "Syntax error; comma in query expression." What
did
I do wrong?
--
Michael


Rick B said:
If([Field1]*[Field2]>40, 40, [Field1]*[Field2])



--
Rick B



I need to calculate the product of two controls in a report but do not
want
the product to exceed the number 40. In all cases where the number 40
is
exceeded, the maximum value returned must be 40. Any help is
appreciated.
 
Back
Top