Solved

Total Amounts on 2 Different Forms

Posted on 2011-03-18
6
271 Views
Last Modified: 2012-05-11
Hi Experts –

I need some help with my database form I’m trying to total up the data in 2 fields on my frmAccounts form AcctDollars and CashCollateral the 1st amount is $10,000 and the 2nd is $2,500 it should total up to $12,500 but not $696,610.00 and that’s wrong.

Next I want to sum up the Sub Total on Accounts Form in the Grand Total Collateral on the Total Accounts Form under the Total Collateral textbox so that the sum there should be Sub Total from Accounts Form ($12,500) plus Lit Mgr Proceeds ($3,500) from Total Accounts Form equaling $16,000 in the Grand Total Collateral textbox on the Total Accounts Form.

***** see example database *****

Thanks in advance,
GeneBat

sumtotals.mdb
0
Comment
Question by:GeneBat
[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
  • 2
6 Comments
 
LVL 3

Expert Comment

by:DockieBoy
ID: 35169625
Hi there,

Bound forms are not my forte, however, setting the control source of your unbound text box on your form to Sum(your stuff here) will give you the sum of all of the records. eg;  your form frmAccounts has four records, the sum that you see in your unbound text box is the sum of all the amounts form each record, hence the $696,610.00

Try this;

In the forms On Current event, put the following code;

 Me.LitMgrProceeds = Me.AcctDollars + Me.CashCollateral

As for your grand total, Is there any reason why you can't do that on the same form "frmAccounts"?  both your forms have the same table as the record source.

If it has to be two forms, then my first suggestion would be to rename the unbound controls on each of the forms as you have the named the same as controls that are bound.  While this is not causing a problem as is, it's not a good idea.  Iwould suggest maybe "txtSubTotal"  For the sub total on your form "frmAccounts"  and "txtGrandTotal"  for the grand total on your form "frmAccounts_Total"

Once you have done this, on "frmAccounts_Total"  add the controls for AcctDolars and CashColateral and set the visibility property to no for both controls.  Next, use the On Current event again and add the following code;

Me.txtGrandTotal = Me.AcctDollars + Me.CashCollaterol + Me.LitMgrProceeds

See how that goes :)
0
 

Author Comment

by:GeneBat
ID: 35169849
This is just a little example of a larger database. And in that larger database the control source is different. I just need to know how to do the concept because in my real app I'll need it to work that way. Which is putting the Grand Total on another form in a text box.

As for you answer the first part of the answer might work. But I have to put the grand total on the other form in my real world app and I not putting my sensitive data up here for the world to see.

Thanks again but its not complete.
0
 
LVL 7

Accepted Solution

by:
DIIRE earned 500 total points
ID: 35169911
Is that what you mean.

See new Forms I added tblaccounts and tblAcounts_Total.

Generally what you want to do is best done with a query but the forms I attached will do the same.

 sumtotals.mdb
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:GeneBat
ID: 35172384
I will test your solution in my production app and let you know DIRE but so far it looks like it's working the way I want it too.
0
 

Author Closing Comment

by:GeneBat
ID: 35181291
Thanks! It worked as expected.
0
 
LVL 7

Expert Comment

by:DIIRE
ID: 35187702
That's great.  Glad it's working the way you want.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

688 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