How To Recalculate All Records

vdanelia

Registered User.
Local time
Yesterday, 19:02
Joined
Jan 29, 2011
Messages
215
Hello Mates!
I Made a command button to recalculate the field values (For Emergency if somewhere accidentally was left not calculated)
here is My Code:
Me.Sumall = Me.Quantity * Me.Unitprice

It works only the current record (Which I See on the form)

My task was: To search the given field values and if there was not calculated then to be recalculated that field values (With Given Criteria)

Thanks In Advanced
 
Why don't you put it in the Control Source?

=[Quantity] * [Unitprice]
 
Hi vbaInet
Because It only displays the result (I know it is Good and simple, I'm using that in other access projects) and not storing in the database (Frequently I exporting the data for users in excel and that value is very important)
 
I don't understand what you mean by "it displays the result". In what event did you put your original code?
 
I meant that the SumAll result is not stored in table
I have a table with fields (there are other fields too but I'm focusing only them)
Unitprice - A unit price of the product (RecordSource Unitprice)
Quantity - Quantity is automatically counted (It is not so important)
SumAll - gives a total sum of the products (Record source SumAll) Here On Enter I use that vba code. but my problem was sometimes when I enter the data On Unitprice then i have to click on SumAll to give me the calculation. I want to avoid this
 
Sometimes I have to export the table to Excel for other persons, and the SumAll calculation must be there
 
No need to store the value. Queries can be exported.
 
So like GalaxiomAtHome mentioned, you can export queries. Move the calculation to a query and export the query. If you want a total sum at the bottom, create a report, sum at the report footer and export the report.
 
Good to know that you took on board what you were adviced.

Good luck with the rest of your project.
 

Users who are viewing this thread

Back
Top Bottom