[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Total Amounts on 2 Different Forms

Posted on 2011-03-18
6
Medium Priority
?
279 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 2000 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

650 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