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.
Who is Participating?
mbizupConnect With a Mentor Commented:
<< 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...
You can refer to a textbox in your subform containing the total in VBA like this:


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)
DatabaseDekAuthor Commented:

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

Does it have to be a text control?
DatabaseDekAuthor Commented:
Spot on!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.