Using query to Add to an existing total?

NewShoes

Registered User.
Local time
Today, 13:14
Joined
Aug 1, 2009
Messages
223
Hey all,

Please can someone let me know if this can be done in a query?..

If I have a total figure stored in a table, and I enter a new figure in a form. Is it possible to add the new figure in the form to the total figure in the table?

For example, if I have 10 stored in a table, and I enter 5 in a form and hit an Update button, I would like the total to then be 15 in the table.

Many thanks for any help!,
-NS
 
Hi..

This is the most simple way..:

Code:
dim trz as integer
trz =me.textbox_name

currentdb.execute "update table_name set field_name =field_name +" & trz
 
Last edited:
Thanks Taruz for your solution. I was trying to avoid VBA if I could...is this possible with some sort of Update query or similar?

Thanks,
-NS
 
Hi again.. ;)

update table_name set field_name=field_name+ [forms]![form_name]![textbox_name]
 
I prefer to write the record away then do 2 Queries:

Total = 0

then
Total = Total + whatever

Simon
 

Users who are viewing this thread

Back
Top Bottom