Solved

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

Posted on 2016-11-26
6
22 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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 119

Accepted Solution

by:
Rey Obrero 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now