Solved

Total Amounts on 2 Different Forms

Posted on 2011-03-18
6
265 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

758 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

19 Experts available now in Live!

Get 1:1 Help Now