Link to home
Start Free TrialLog in
Avatar of Derek Brown
Derek BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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.
Avatar of mbizup
mbizup
Flag of Kazakhstan image

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)
Avatar of Derek Brown

ASKER

Hi

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

Does it have to be a text control?
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Spot on!!