Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated fields

Status
Not open for further replies.

rnpIII

Technical User
May 2, 2001
61
US
Hello All,

I am creating a form based on a query. The Query has several calculated fields which must be written back to the original table.

I have no idea how to go about this. I am using Access 2000.
I thought I knew what to do, but I am stumped.

Do any of you able- bodied people have some suggestions of how I should handle this?

I have read through the forums and don't quite have the answer I need.

Any simple and non technical info on this would be helpful.
I normally consider myself a technical user. This makes me feel an idiot.

Thank you for your time and patience.
 
Well, it has always been advised to NOT write calculated data to a table. The general theory is that if you can calculate it once, you can do it again. If you must store it, if you do a keyword search here for "calculated", I bet you will find the help you need to do this, but I bet you will also see "DON'T" at least once per thread.

If you don't find your answer in a search, respond back and I am sure we can help. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
As a general rule if the field is calculated there is no reason to write it back to a table unless you are trying to keep history or something like that. and I can not think of a reason why you would ever want to write it back to the original table.
if you must write the calculations back to a table from a form then the first thought that pops into my head would be something like

dim db as database,rst as recordset
dim strcrit as string
strcrit ="keyfieldname = '" & textboxwith keyfield &"'"
set db = currentdb
set rst= db.openrecordset("tabletoupdatename")
with rst
findfirst(strcrit)
!fieldtoupdate = textboxonformholdingcalculatedfield
'do like the above line for each caluclated field
end with
rst.close
above code not intended to function just to give general idea

hopefully I got a grasp of the problem. Good luck
 
Thank you th3856.

I was searching for "calculated fields".
 
Hello braindead2,

I will try this out and see what it gets me. Hopefully not more headaches.

I am keeping a history. I am also trying to make sure this can be brought into a Excel spreadsheet for distribution and other calculations among my team.

Thanks again,

rnpIII
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top