Store Calculation from text box in table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know it is not generally a good idea to store calculations in a table but
for my application there is no way around it i need to store the difference
of 2 times. Many people use the table resulting from the form and it is
outputed to excel alot. So is there anyways at all to get the calculation to
store in the underlying table?
 
"Many people use the table" ?? As far as I am aware tables should never be
touched.

You are better off doing the calculation in a query and allowing users to
export information through a form.
 
The table records events that have occured, it is very large and people
export it to do graphs for analysis and reports. Is there a way to get the
from to export a large amout of records into a excel sheet?
 
Yes, you create a query that has the calculation in it, then you use it in
the Table Name argument of the TransferSpreadsheet method to export it to an
Excel file.
The only justification for ever storing a calculated value in a table is
when the data necessary to produce the calculation will never be available
again. In this case, you have the two times and can easily reproduce the
calculation.
 
The table records events that have occured, it is very large and people
export it to do graphs for analysis and reports. Is there a way to get the
from to export a large amout of records into a excel sheet?

Use a Query instead of the Table. It exports to Excel in exactly the same way.

John W. Vinson [MVP]
 
DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "QUERYNAME", _
"EXPORT LOCATION", , "NAME OF SHEET IN WORKBOOK"

Change those in capitals and put the code in the "on click" event in the
button. You can have as many as you like in the same event.
 
Back
Top