473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Help! Need to calculate and store value based on total in Subform

11
I am trying to create an invoice program that will automatically generate an invoice based on charges entered in a subform. Sounds easy enough!

I have created my Total field on subform as unbound and called it Ttl. I have used this code to tally the total of all charges =Sum([Charge]). This works fine. I have then put a GrandTotal filed on my Customer info form and asigned it this value =frmCharges.Form!Ttl. Again, the field total looks fine as long as I only enter one charge. Problem is I there will be multiple charges for most invoices!
I have entered the recalc code in the OnChange but still nothing.

What am I doing wrong here!!
Jan 31 '08 #1
3 1753
puppydogbuddy
1,923 Expert 1GB
I am trying to create an invoice program that will automatically generate an invoice based on charges entered in a subform. Sounds easy enough!

I have created my Total field on subform as unbound and called it Ttl. I have used this code to tally the total of all charges =Sum([Charge]). This works fine. I have then put a GrandTotal filed on my Customer info form and asigned it this value =frmCharges.Form!Ttl. Again, the field total looks fine as long as I only enter one charge. Problem is I there will be multiple charges for most invoices!
I have entered the recalc code in the OnChange but still nothing.

What am I doing wrong here!!
ezra,
The OnChange event does not fire for calculations or updates via code. It fires only for changes due to data input. Try to move the recalc code to the Form_BeforeUpdate() event for the subform, and see if that helps.
Feb 1 '08 #2
ezra
11
ezra,
The OnChange event does not fire for calculations or updates via code. It fires only for changes due to data input. Try to move the recalc code to the Form_BeforeUpdate() event for the subform, and see if that helps.
Thanks

The form field does calculate properly now but the correct total doesn't stored in the Total field in the underlying table.
Feb 1 '08 #3
puppydogbuddy
1,923 Expert 1GB
Thanks

The form field does calculate properly now but the correct total doesn't stored in the Total field in the underlying table.

ezra,
as a general rule calculations are not stored in the table because they can derived any time from the stored components any time it is needed. However, if you want to store it irregardless, you can. Add the following line to the Form_AfterUpdate() event of your subform, assuming that the subform record source is the table that has the total field.

YourFieldName = Me!YourControlName
Feb 1 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
2
by: John Baker | last post by:
I find it highly annoying that MS Access tries to go online when I want to look at the help files. Is there a way to configure it so it just looks at my local helpfiles when I hit F1?
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
9
by: JJ | last post by:
Do you all use HTML help workshop to create your help system. I am finding it quite clumsy to use. Mayeb because I am not used to using it. Do any of you use any other techniques to create help...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.