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

Storing a value from a calculated field

Status
Not open for further replies.

sgfromny

Technical User
Jan 17, 2003
120
US
I have a report that calculates totals of dollars, I want to take that sum and move it to a table or store it somewhere I can re-use it. Is this possible?
 
That does seem the hard way to do things. You should be able to do the calculations right in a query and use them from there but you can store the calculation in a Table if you want. You would need to put something like this in the Format event in the Section your Textbox is in.

Dim strSQL as String
strSQL = "Insert Into TableName([FieldName]) Values (" & [ControlName] & ")"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True

You will probably want to set up a delete query that deletes the records from TableName when the Report is opened so that if you run this multiple times you don't store values that you don't want but you will need to decide this.

Post back with specific problems.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top