Help with Sum for a Subform value

xenos132

Registered User.
Local time
Yesterday, 21:16
Joined
Jan 9, 2005
Messages
15
I am trying to sum a value on my main form based on a value in a queried sub form. I know if I use

=[QueTimeSheets subform].Form!Hours it will display the first record, however I want to sum all the hours displayed on my sub form. Regard less of what I try I always seam to get an error. Could someone please lend some advice.

I thought this would work but it dosen;t.

=sum(Forms![FrmHVBServiceOrders]![QueTimeSheets subform].Form![Hours])

Thank you
 
Sum

When creating totals you have to have a detail section i.e. in the example shown I have created a report that calculates the following;

Cost of Item * Quantity of Item

It is then creating a running sum to calculate the total cost of an order. What you have to do is create a section for each Attribute you wish to base the calculation on. In my example I have done this on Order Number

Not to sure whether this will help but hope so.
 

Attachments

  • Example.JPG
    Example.JPG
    45.9 KB · Views: 154
Thank you

When dealing with a simple query like.

=Sum([Hours])

If my Hours is a null value I get an error, How would I write this to allow null values?
 
In the table have you predefined hours to accept null values? Another way is to simply insert 0 because that is still a value which would still cause a calculation to be 0 or null.
 
All I had to do was allow edit's :(
 
Last edited:

Users who are viewing this thread

Back
Top Bottom