Solved

Total Amounts on 2 Different Forms

Posted on 2011-03-18
6
266 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
My experience with Windows 10 over a one year period and suggestions for smooth operation
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

911 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

15 Experts available now in Live!

Get 1:1 Help Now