473,769 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving calculated values, Please

I know that this is not the way, however I need to save certian
calculated values so that they do not change over time, ie. new tax
rates etc. This is for an invoice header and invoice subform. I have a
form myheader and mysub that are linked via a invoice number. mysub
calculates qty * list = extprice. I am summing these into a sum_ext
field in mysub footer. I need to have this value updated into the
myheader invsubtot. I have tried many variations to get this but the
closest I have come is to have it updated AFTER the second transaction
to the FIRST transactions value. Is there a way to use on change
control of the mysub in the footer to trigger an updating of invsubtot
in myheader or something? I have been banging on this till I am going
in circles. Thanks ahead of time for the help.
Nov 12 '05 #1
1 2182
There are a couple of ways to "save" the calculated values.

1) Make a table for the data that can change and keep track of it there. For
example, if the sales tax rate changes, in the table you would place the
date of the change and the new rate. You could then use the date of the
invoice to go back and look-up what the tax rate was on the date of the
invoice.

2) In the form with the calculated textbox you would use the BeforeUpdate
event of the form to change the value in a textbox that is bound to a field
in the table. You would set the value of this textbox to the value of the
calculated textbox. The field in the table would be your "saved" calculated
value. This could be modified to only save for new records, not changed ones
if you wish. To do that just check to see if you're at a new record (If
Me.NewRecord Then)

--
Wayne Morgan
Microsoft Access MVP
"douh" <do**@tskgrindi ng.com> wrote in message
news:8c******** *************** **@posting.goog le.com...
I know that this is not the way, however I need to save certian
calculated values so that they do not change over time, ie. new tax
rates etc. This is for an invoice header and invoice subform. I have a
form myheader and mysub that are linked via a invoice number. mysub
calculates qty * list = extprice. I am summing these into a sum_ext
field in mysub footer. I need to have this value updated into the
myheader invsubtot. I have tried many variations to get this but the
closest I have come is to have it updated AFTER the second transaction
to the FIRST transactions value. Is there a way to use on change
control of the mysub in the footer to trigger an updating of invsubtot
in myheader or something? I have been banging on this till I am going
in circles. Thanks ahead of time for the help.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2965
by: SJH | last post by:
I have been given an older database and asked to make upgrades and what not. One interesting thing I have come across with the database is that it was at one time set up so one of the tables would hold values that were calcuated using a form. I have looked at the code for all the text boxes on the assocatied forms and have yet to figure out how this was done. There were two values set up this way, one still works and the other one...
0
2076
by: Henry | last post by:
Hi Is there any good ideas how to update form vb code always after some values are changed / added by vb (not user). I have some code behind subforms vb and there are calculations behind "Form_Current" section those I need to re-calculate after some values are changed or added. The problem is that if list box value is calculated in vb, access wont
3
5330
by: Jeremy Weiss | last post by:
I've got a temp table that contains the fields: amountowed, amountpaid, and balanced. I've got a form that shows this information and I've set it up so that when the amountpaid field is changed it subtracts the amountpaid from the amountowed and display's it in the balanced field. Unfortunately it doesn't save what is displayed back to the table. It does, however, save the changes to the amount paid field. I'm assuming my problem is...
2
1777
by: Douglas Buchanan | last post by:
I set the OnExit property of the "Cost" field in subform "subJobDetail" to save the record (see below). Then I call a global sub to copy the )] calculated field to a field in the subform "subJob". The record in "subJob" displays the "writing" (pencil) icon for the record but does not update visually until I enter and exit a second field "Markup" that is identically coded. How do I write code to save the record in the subform "subJob" ...
5
4056
by: John Bahran | last post by:
I am trying to use calculated fields in my query but all the results are zero ven when they're not. Please help. Thanks.
18
3800
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having trouble. I have tried keeping some of the fields bound and when I use the save button it has been saving as 2 different records. This is unacceptable. This is what I have, can anyone help me out with this?
1
2410
by: mazdotnet | last post by:
Hi guys, I have to make a event signup page for our company that would display the event time/date in 3 different time zones (Eastern - New York, Central - Chicago, and Pacific - San Francisco). To do this. I convert the inputed date from local time zone and convert it into UTC and store it in the database (correct me if I'm wrong please). Next to display it I would add the correct time zone difference value (-5 for Eastern). How to do...
8
3663
by: Gilberto | last post by:
Hello, I have created a query to help me calculate some total values i need for a report. In the query field i have the following: TCL1: Costing!*(Engineering!+Engineering!) The results are calculated correctly for the report, however now i need this calculated values (from TCL1 on the query) to be stored in a table (COSTING) under the same field name (TCL1).
5
1798
by: royals | last post by:
Hello Access gurus, I am a self-taught Access “developer” and have a ton to learn so please allow me to sound stupid. I am using 2003 on a XP platform. I manage properties for an organization. At times it is necessary to pay an individual to stay in a house so that it isn’t vacant for an extended period of time. The organization pays the entire utility cost but deducts the individual’s usage cost. In other words, they receive...
0
10208
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7404
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.