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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated Field on a Form

Status
Not open for further replies.

bren11

Programmer
Mar 14, 2002
21
US

I have a form based on multiple linked tables and a union query. On the form is a calculated field that I want to store in a table. Using SetValue returns an Automation error, and I can't really calculate that value in my query.
Can anyone help?

Thank You
 
Calculate the value on the form. Don't store it in the table. This is widely considered a no no. If you calculate it and store it in the table, then any time any data changes you need to recalculate it or it will be wrong. Terry
 
I need to import the calculated value into 3rd party software which only allows ODBC from table fields. That's why I need to store it in a table first. I do appreciate your suggestions.
 
Okay, if you have to do it, try this. Add the field to your table. Create an UPDATE query that will set the value for each record:

UPDATE MyTable
SET MyTable.NewField = SUM(OldField1 * OldField2);

Hope that helps... Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top