Subtotals on Fields with Numerical & String Data

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!
 
D

Duane Hookom

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.
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top