Solved

Display running total on Mainform based on value on Subform datasheet

Posted on 2014-02-07
3
2,959 Views
Last Modified: 2014-02-12
form
drawing a blank on the best way to display a running total.

I want to have the field MCF Paid refresh its value when the user enters a NetAmount on a new invoice Datasheet (subform)

I have tried dsum, Recalc, change focus back to mainform and recalc - all without success.

What am I missing.

K
0
Comment
Question by:Karen Schaefer
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
Comment Utility
Best way is to put a control in the subforms footer (you can set the footers visible property to No).  Give it a name txt_MCF_Paid_Total

Set the control source of that textbox to something like:

=SUM([MCF Paid])

Then in the main form, set the control source of the control where you want to display that value to (change the names to match yours):

=Forms!yourMainFormName!subformControlName.Form.txt_MCF_Paid_Total
0
 
LVL 16

Assisted Solution

by:Sheils
Sheils earned 250 total points
Comment Utility
Try adding an after update event in the NetAmount  textbox in your subform to change the value displayed in the main form

Something like:-

Private Sub TxtBoxName_OnChange()

Forms!MainFormName.MCF=DSum("fieldname","tablename","idfield=" & Me.ID)

fieldname and tablename are the name of the field and table that contains the net amount.
idfield is the id that links the main form and the subform.
0
 

Author Closing Comment

by:Karen Schaefer
Comment Utility
thanks that did the trick
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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.
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now