Total in a subform

  • Thread starter Thread starter Ivor Williams
  • Start date Start date
I

Ivor Williams

I've a form with a subform which uses as a record source a query. In the
subform is a text box named txtWorkHours which uses as a control source a
calculated field in the query.

In the footer of the subform, I've added an unbound text box. In the Data
Control Source property for the text box, I entered the following:
=Sum([txtWorkHours]).
When I open the form, instead of getting a value, I get #Error.

Please explain.

Ivor
 
Ivor Williams said:
I've a form with a subform which uses as a record source a query. In the
subform is a text box named txtWorkHours which uses as a control source a
calculated field in the query.

In the footer of the subform, I've added an unbound text box. In the Data
Control Source property for the text box, I entered the following:
=Sum([txtWorkHours]).
When I open the form, instead of getting a value, I get #Error.

Please explain.


You can't Sum a text box, only a field from the form's recordsource. If,
for example, the calculate field in the query is named "WorkHours", then use
the expression:

=Sum([WorkHours])
 
Back
Top