Solved

Total Amounts on 2 Different Forms

Posted on 2011-03-18
6
267 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook 2012 VBA: Object missing 14 33
ms access filter query with empty combobox 5 29
Problem to file 5 15
Display <> "Yes" records 10 10
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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.
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 …

777 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