Thank you for such a prompt reply. Unfortunately, you have left me
completely and utterly confused. Why would I want to sum a text
field?
You're not summing the field, you're summing the numeric result of
either a function (IIf) or a conditional expression that returns a
logical value.
Maybe it is my fault for not properly explaining what I am trying to
accomplish: The field is contained in a subform form. I am trying to
add a unbound text box to the main form to total the number of times
the field [Q'd] appears in the subform with a value = "Q."
I tried =Sum(IIf([Q'd]="Q", 1, 0)) and it gave an #Error.
I didn't understand that the totalling text box is on the main form,
while the field to be summed is on the subform. Here's how you do that:
1. Create a text box in either the Form Header or Form Footer section of
the subform. This text box does not have to be visible, and probably
won't be -- in fact, the whole section need not be visible, if you
aren't using it for anything else. (Both controls and form sections
have a Visible property that you can set to No on the Format tab of the
property sheet.)
2. Name this text box "txtCountQs".
3. Set its ControlSource property to the expression I gave before:
=Sum(IIf([Q'd]="Q", 1, 0))
4. On the main form, have a text box to display the value of the text
box on the subform. The ControlSource of *that* text box will be:
=[frmAgRecsData].[Form]![txtCountQs]
That ought to do it, provided that "frmAgRecsData" is the name of the
subform control on the main form, and not just the name of the form
object it displays.