Lowering quantity

D

DDD

i have a table containing records of different products, i have fields like
name, quantity so on. i have made another table called sales, each record in
this can only be for 1 record in the first table. The field in this also has
quantity

For each sales record how do i update the quantity of a product in the first
table..

e.g. i have 15 watches & have sold 7, how do i make the number 15
automatically change to 8.

Please can any1 explain to me how to do this, as simply as possible
 
M

Maurice

You'd have to make an update query,

In the update query place the two tables you use. Join them on the
appropriate keyfield.
In the update field of 'Quantity' place the following:

[table1].[quantity]-[Sales].[quantity]

You should rename the tablenames according to your situation (i assume the
second table is called sales.

Before doing any executing make sure you have a backup of the database just
in case.

hth
 
Top