Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-11-26
6
Medium Priority
?
66 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

715 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