Subtotals on Fields with Numerical & String Data

  • Thread starter Thread starter DDJ
  • Start date Start date
D

DDJ

We're creating a report that subtotals (in the Group Section) a field in the
Detail section which generally contains currency data (the control source is
also linked to a table field which has a currency data type).

We occasionally need to show a string in this field (such as "No Charge"),
and have not been able to figure out a way to do this. Even if we leave the
formatting of the report field as "General", we end up getting errors in the
subtotal field.

Can anyone suggest the appropriate way to do this?

Thanks!
 
Use the format property (not the control source property) to set various
formats for numeric data. This will then have no effect on the actual value.

Setting the format property allows you to provide different display formats
based on Positive, Negative, Zero, or Null values.
 
DDJ said:
We're creating a report that subtotals (in the Group Section) a field in the
Detail section which generally contains currency data (the control source is
also linked to a table field which has a currency data type).

We occasionally need to show a string in this field (such as "No Charge"),
and have not been able to figure out a way to do this. Even if we leave the
formatting of the report field as "General", we end up getting errors in the
subtotal field.


Where are you "converting" the value to "No Charge"? If
it's in the record source query, then the subtotal can be
calculated using an expression like:
=Sum(IIf(IsNumeric(thefield), thefield, 0))

If you're doing something else, please provide the details.
 
Back
Top