Form footer using subform data

G

Guest

The parent form only has a combo box that is filled with employee names. The subform has a datasheet view of all the training they've had to date, including the hours. I need to put a text box in the footer of the parent form that will total the hours. Here's what i've tried, but so far no luck.

=Forms![Training Subform]![Training Units] is what I started with. I know this only picks up the value in the first record on the subform, but was trying to build on that

=Me!Sum(Forms![Training Subform]![Training Units]) gives a #Name? error
=Sum(Forms![Training Subform]![Training Units]) gives a #Error? error.

What am I doing wrong?
 
D

DEvans

Hi You might want to try using the domain aggrate function
dsum(field to sum, datatable,criteria) or you could just
use the formula sum(datafield). Try these! use the simple
exampl first, you should need to use the me! etc...

-----Original Message-----
The parent form only has a combo box that is filled with
employee names. The subform has a datasheet view of all
the training they've had to date, including the hours. I
need to put a text box in the footer of the parent form
that will total the hours. Here's what i've tried, but so
far no luck.
=Forms![Training Subform]![Training Units] is what I
started with. I know this only picks up the value in the
first record on the subform, but was trying to build on
that.
=Me!Sum(Forms![Training Subform]![Training Units]) gives a #Name? error.
=Sum(Forms![Training Subform]![Training Units]) gives a #Error? error.

What am I doing wrong?
.
 
J

Jennifer H

You can also add a field in the footer of the subform
that totals the records on the subform. Then reference
that field on the main form.
-----Original Message-----
The parent form only has a combo box that is filled with
employee names. The subform has a datasheet view of all
the training they've had to date, including the hours. I
need to put a text box in the footer of the parent form
that will total the hours. Here's what i've tried, but so
far no luck.
=Forms![Training Subform]![Training Units] is what I
started with. I know this only picks up the value in the
first record on the subform, but was trying to build on
that.
=Me!Sum(Forms![Training Subform]![Training Units]) gives a #Name? error.
=Sum(Forms![Training Subform]![Training Units]) gives a #Error? error.

What am I doing wrong?
.
 

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

Similar Threads

Subform Multiple Entries 1
Creating Unique Front End 1
subforms 1
Checking for duplicate record 3
Syntax error in form 4
Subform question 1
Subform Requery Not Working 3
no edit combo box? 4

Top