Solved

Trying to display the sum of values on a subform on the main form

Posted on 2016-11-26
6
61 Views
Last Modified: 2016-11-28
I have a field on a subform named txtQuantity.  Then on the main form I want to show the sum total of the values entered in that field on the main form in a field named txtGrandTotal.  I keep getting #Error or #Name, etc.

What am I doing wrong?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41902403
what is the Control Source of textbox "txtGrandTotal"

try
=me.subformControlName.form!txtQuantity

if that doesn't work, create another textbox in the subform,  txtSubtotal and set the controlsource to =sum([txtQuantity])

then use this in the control source of the  textbox "txtGrandTotal"
=me.subformControlName.form!txtSubTotal
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41902417
correction,

if that doesn't work, create another textbox in the subform FOOTER,  txtSubtotal and set the controlsource to =sum([txtQuantity])
0
 

Author Comment

by:SteveL13
ID: 41902640
Is very frustrating.  I've attached a stripped down version of the database.  When you launch it, with the items I have selected in the subform, the field on the main form should read 138  (15 + 123).

I cannot get it to work.

?????
SubForm-Example.accdb
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 41902677
here is the revised db.
created a new subform and a query as the record source of the subform
SubForm-Example.accdb
0
 

Author Comment

by:SteveL13
ID: 41903219
That did it!!  I just wish I could figure out why the new subform and query as the record source did the trick. ?????
0
 

Author Closing Comment

by:SteveL13
ID: 41904147
That did it!!  I just wish I could figure out why the new subform and query as the record source did the trick. ?????
0

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question