Errors in Reports

R

rico

I am using the following two expressions to calculate the sum total of a
column in a form which contains both numerical and non-numerical values. If
the column [LineTotal] does contain a non numerical value (in my case a "-")
the calulating is called off. This is the first called Subtotal:
Sum([LineTotal]) which is in the subform. Then on the main form Total:
=IIf(IsError(OrdersItemsform.Form!Subtotal),"-",OrdersItemsform.Form!Subtotal).

This all works perfectly the way i want, but when i replicate this in a
report i get a data mismatch error. Infact if i used Sum() that might
generate an error in any way i get a mismatch. I have also checked that that
all my reports field have no specific format.

I'm completely at a loss, what works on a form doesn't in a report!?!

I'd be very greatful for an help.

TIA

Rico
 
T

Terry

Rico,

Try:

Sum([linetotal]*1)
Multiplying the control by 1 has no impact on the value
yet Access seems to then treat the result as a number and
not text.

HTH

Terry
 
R

rico

Thanks Terry, nice idea but still gives me a data mismatch error

Terry said:
Rico,

Try:

Sum([linetotal]*1)
Multiplying the control by 1 has no impact on the value
yet Access seems to then treat the result as a number and
not text.

HTH

Terry

-----Original Message-----
I am using the following two expressions to calculate the sum total of a
column in a form which contains both numerical and non- numerical values. If
the column [LineTotal] does contain a non numerical value (in my case a "-")
the calulating is called off. This is the first called Subtotal:
Sum([LineTotal]) which is in the subform. Then on the main form Total:
=IIf(IsError(OrdersItemsform.Form!Subtotal),"- ",OrdersItemsform.Form!Subtotal).

This all works perfectly the way i want, but when i replicate this in a
report i get a data mismatch error. Infact if i used Sum () that might
generate an error in any way i get a mismatch. I have also checked that that
all my reports field have no specific format.

I'm completely at a loss, what works on a form doesn't in a report!?!

I'd be very greatful for an help.

TIA

Rico
.
 
Top