Subform total in Main form

Hi All

I have a subform that calculates a total from data in the subform. The main form also has calculated totals. I want the total from the subform to be part of the grand total on the main form.

I have been told that this should not be done grammatically as part of an event.
Derek BrownMDAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbizupCommented:
You can refer to a textbox in your subform containing the total in VBA like this:

Me.SubformName.Form!txtTotal

You can also use that same reference in a control source property, but omit the "Me." if you are using this in a property sheet or query ("Me." is a VBA prefix)
0
Derek BrownMDAuthor Commented:
Hi

Can this SubformName.Form!txtTotal be used in the main forms query?

Does it have to be a text control?
0
mbizupCommented:
<< in the main forms query? >>

I've actually never tried it like this  -- give it a shot,  You MIGHT run into issues with the order of events, when the form loads...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Derek BrownMDAuthor Commented:
Spot on!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.