Form Totals..

HZM

Registered User.
Local time
Today, 08:12
Joined
Mar 11, 2015
Messages
23
Hey..
As you can see in the pic attached, this is a subform with totals end in a form..
Question is.. any idea how to pick up those 2 totals to perform calculations with them in the downward textboxes ?! like in the first box i would like to divide the [Invoice Amount] total by the [Quantity] total and in the second box will multiply the first box result by other box..
So, the main idea is how to write code to pick up the totals amount and by changing the totals the related calculations changed too !!
 

Attachments

  • ScreenShot.jpg
    ScreenShot.jpg
    48.2 KB · Views: 99
I was going through some old posts and was surprised to find your questions unanswered.
like in the first box i would like to divide the [Invoice Amount] total by the [Quantity] total
Code:
=Sum([Invoice Amount]) / Sum([Quantity])

and in the second box will multiply the first box result by other box..
Code:
=[Text114] * [Other box]
... I have no idea what other box you're referring to hence [Other box]
 
Thanks for your willing to help me in this situation..
Actually i've found 2 ways for doing that..
1st one:
Was your way.. but here i've to write the Sum() function in the footer of the subform, then refer to it in the textboxes on the main form that's including the subform..
i could write the Sum() function correctly and get it working, but dunno why when i refer to it in the textboxes it give me an error (#Name?)..?!
(Maybe you know how to succeed in it! :D)
2nd one:
Was to enter a DSum () function in the main form textboxes which filter the field of totals with certain criteria according to what the subform displays !!
 
Good, putting it in the footer is the way it should be done.

How do you refer to it?

DSum() isn't necessary in this case but it's another (slower) way.
 
Here's what i wrote in the textbox of the main form..

Code:
=[Forms]![Subform Invoices for Data]![AvgTransferred]
Where: [AvgTransferred] is the textbox in the subform that contains the Sum() function..

Check the pic attached to see the error that i get .. :c
Hint: i've changed the subform view to 'Simple form' for just being sure that the Sum() function is working..
 

Attachments

  • ScreenShot.jpg
    ScreenShot.jpg
    15.8 KB · Views: 74
#Name error indicates that reference is incorrect. What you need to do is use the Expression Builder to find the subform control.
 
Indeed, that's what i did exactly .. !!
And as i said, it's giving this error !! :/
 

Users who are viewing this thread

Back
Top Bottom