Allen Browne Running Total on subform won't work

T

T

I have 3 fields in a subform that hours are entered. I
also have one field on the subform that totals all the
hours entered in each of those record. I would like to be
able to have a running total of all hours entered on the
form I have tried the sum function and dsum and can't get
it to work Can someone help ? Mr Browne this is what I
tryed

=Sum(Nz([Executive Flight Hours]),0) + Nz(Sum([Law
Enforcement Hours]),0) + Nz(Sum([Aid to Other Agency
Hrs]),0) It gives me an error
Thanks for your help
 
A

Allen Browne

Where did you place this text box? (What section?)
What is its name? (Can't be the same as any field in the subform's
RecordSource)

What is the RecordSource of the subform? Table or query?
Are the 3 fields in the Record Source? Is that their names? Are the text
boxes on the form showing the same names?

Are there any records in the subform when you get this error?
 
G

Guest

Where did you place this text box? (What section?)FOOTER
What is its name? (Can't be the same as any field in the
subform's TEXT20
RecordSource)

What is the RecordSource of the subform? Table or query?
TABLE
Are the 3 fields in the Record Source? Is that their
names? Are the text
boxes on the form showing the same names? YES

Are there any records in the subform when you get this
error? YES SEVERAL
 
A

Allen Browne

Double check it is in the Form Footer section, not the Page Footer section.

Try getting one at at time, until you find the source of your problem, e.g.
try:
=Sum([Executive Flight Hours])
as the Control Source.

Once that's working, add the Nz(), i.e.
=Nz(Sum([Executive Flight Hours]), 0)

Then try the others.
 
G

Guest

Try using DSum again in a text box. You will need to
reference your query where the records are stored. Also,
make sure you reference your subform, or the running total
will only work in the subform but not the parent form.
Here is an example of one that I used to get a running
total hours for an employee. The employee's total hours
were divided out by year, and I had multiple employees in
the query. You should be able to modify this for your
form.

=DSum("[Hours]","[qrySubHrs]","[EEID]=Forms![frmHRS]!
[frmSubHrs]![EEID] And [Year]<=Forms![![frmHRS]!
[frmSubHrs]![Year]")
 

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

Adding two subtotals together. 2
Conditional Sum 4
Running total on a form 1
Subform Totals 4
Total Detail on Continuous Form 2
Running Total from a Subform 1
TOTAL FEMALE AND MALE 1
Totals Row Not Summing 3

Top