Stock Updation

mkkashif

Registered User.
Local time
Today, 00:02
Joined
Sep 1, 2004
Messages
88
I want to know what is the profesional approach to update stock.i am using the learning database northwind.
in orders detail i create a field which dlookup the stock.
i want to know how i update my stock.
update query.or any other way.
please any body can refer me a sample file in which the stock updation shows.
 
Hi,

I used the following way to know the current stock of the items. I don't know how much it is considered as professional.

Assume that I have 3 tables (represented thru differerent subforms with thier main forms)

1. T_Cash_Sales_Footer
2. T_Credit_Sales_Footer
3. T_Cash_Purchase_Footer


When you are working on cash_sales subform, you should get current stock of a particular item when you click the list combo of your item using following code. (assume your combo or list box name on subform is Product_Name)

Private Sub Product_Name_AfterUpdate()

Me.Refresh
Stock = Nz(DSum("Qty", "T_Cash_Purchase_Footer", "Product_Code = " & Product_Code), 0)

Stock = Stock - Nz(DSum("qty", "T_Credit_Sales_Footer", "Product_code = " & Product_Code), 0)

Stock = Stock - Nz(DSum("qty", "T_Cash_Sales_Footer", "Product_code = " & Product_Code), 0)
Me.Refresh

End sub

Hope this help.

Regards,

Ashfaque
 

Users who are viewing this thread

Back
Top Bottom