Hi,
I am creating an inventory management database.
I have three tables in this database, Products, Orders and Order Details.
I have a form Order Entry in which i create an order to be shipped to a client.
This form is created using a query that combines all fields of Orders and Order Details table.
The upper part of the order entry form is used to enter basic information such as the order date, client name, address etc.
The lower part of the Order entry form contains a subform (datasheet), where i enter order details.
There are two columns in the order entry subform
products and quantity
the product column actually allows you to select the product from a drop-down list (containing all products) and the quantiy column enables you to enter the total quantity of product shipped to the client.
there is also an Update Inventory button on order entry form.
Now, all i need to do is that after i finish selecting the products and specifying the quantity i would like to ship, I want to click the Update Inventory button, to deduct all the quantities of the products i selected from the Products table.
for example,
i selected D123 as product, and 12 as quantity,
clicking the update button should lookup the product table, search D123, and substract the quantity that is there.
I could have done this if i selected one product, but in the subform, i can select mutiple products. is there a way i can loop throught the products selected, and then deduct quantities.