Lowering quantity

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top