473,385 Members | 1,523 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,385 software developers and data experts.

Saving calculated values

SJH
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 doesn't,
needless to say this has turned the reports into a mess.

I know all about manipulating data using queries, but these values are
stored values that will not change once they have been calculated.

Can someone point me in the right direction as to how calcualted values can
be stored in a table? I am not all that familiar with writing code, but I
can usually figure it out once I see it.

Thanks for any help anyone can offer.

SJH


Nov 12 '05 #1
1 2915
"SJH" <12*****@wwt.net(remove first two)> wrote in message news:<7I******************@reggie.win.bright.net>. ..
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 doesn't,
needless to say this has turned the reports into a mess.

I know all about manipulating data using queries, but these values are
stored values that will not change once they have been calculated.

Can someone point me in the right direction as to how calcualted values can
be stored in a table? I am not all that familiar with writing code, but I
can usually figure it out once I see it.

Thanks for any help anyone can offer.

SJH

first let me say that I'm not sure storing the calculated values is a
great idea. Just base your report on a query that does the
calculations at runtime.

Okay, that said - there's one way to do it *BEFORE* the record is
saved - just put the code to update the values in the BeforeInsert
event of your form. You could have the calculated fields be invisible
and then do something like:

Me.CalcField1=Expression1(Field1,Field2,Field3)
Me.CalcField2=Expression2(Field3,Field4,Field5)

I don't like this approach at all... what if someone changes any of
the values in fields 1-5? Your calculations go up in smoke. That's
what I really don't like about the scenario you describe. So it takes
a few extra seconds for the report to open... big deal. At least the
data is ALWAYS current if you just base it off a query (or several)
and just calculate everything at runtime.

There. I said it. But I wouldn't do what you're proposing unless you
are absolutely sure you want just "historical"/ReadOnly data after
that. If I were going to do that, then I'd skip the complexity and
just use update/append queries to write the calculated values to a
temporary table, then run my reports and then drop the temp tables.
See Tony Toews site for info on temp tables.
Nov 12 '05 #2

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

Similar topics

3
by: Stefanos | last post by:
Hi everybody, I need some help on calculated values in my database design. I'm creating an accounting / business management application with the usual modules like A/R, A/P, Inventory, etc. ...
0
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...
3
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...
2
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"....
0
by: douh | last post by:
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...
1
by: douh | last post by:
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...
18
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...
11
by: James Hallam | last post by:
I have read through all the past topics and couldn't find what I was after so... I am looking to store some calculated values (don't flame just yet, just read on!). I have an piece of code...
8
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.