Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-11-26
6
Medium Priority
?
72 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
  • 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

877 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