table log

awake2424

Registered User.
Local time
Today, 16:22
Joined
Oct 31, 2007
Messages
479
In acess 2010 if there is a table "log" with

Item Amount
Water 100
Egg 200

and another table "setup" with

Item Amount
Water 20
Egg 50

Can the "setup" be used to update the "log"

Water 80
Egg 150

Thanks.
 
Providing there is a field in both tables that relate to each other, then the answer is yes
 
Probably doing your work for you:

I am guessing you want a button to run an update query using the "item" field in both tables. The SQL query would be something like (auto-generated after I used the GUI):

UPDATE log INNER JOIN setup ON log.item = setup.item
SET log.amount = Log.amount-setup.amount;

If using the GUI, create a new query - set it to an update query - display both the log and setup tables -creat the join on the "item" which I assume is the primary key - then under the "Update To:" row enter (Under the log field):Log.amount-setup.amount

Hopefully that will work.
 

Users who are viewing this thread

Back
Top Bottom