• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 81
  • Last Modified:

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

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
SteveL13
Asked:
SteveL13
  • 3
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
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
 
Rey Obrero (Capricorn1)Commented:
correction,

if that doesn't work, create another textbox in the subform FOOTER,  txtSubtotal and set the controlsource to =sum([txtQuantity])
0
 
SteveL13Author Commented:
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Rey Obrero (Capricorn1)Commented:
here is the revised db.
created a new subform and a query as the record source of the subform
SubForm-Example.accdb
0
 
SteveL13Author Commented:
That did it!!  I just wish I could figure out why the new subform and query as the record source did the trick. ?????
0
 
SteveL13Author Commented:
That did it!!  I just wish I could figure out why the new subform and query as the record source did the trick. ?????
0
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.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now