Question How do I display left-over of a product when making a stock-out

PRAISE PHS

Well-known member
Joined
Jun 2, 2011
Messages
58
Programming Experience
Beginner
Pls I'm new to programming(vb.net 2008). I am designing an office inventory management software. I have three forms for Products, Stock-In and Stock-Out; each having there tables in the sqlser 2005 database. Pls how do I code the application such that when am doing a stock-out, immediately i select the item name from a combo box, the left-over quantity of the item should be displayed on a text box. Also when i select the quantity of the item going out(i.e. stock-out), the number of quantity chosen should be deducted from the database table of the product or stock-in and also updated...Pls kindly help me out with this.
 
I'm fairly new to VB.Net as well, so others may have a better solution for you. One way you could accomplish this is to add a button (call it "Update") and add code to its Click event. In the code, you could create a veriables to hold the Product and StockOut quantities and one for results. I'm not sure how your form is set-up or what textbox names you're using, but below is one way you could write the Update button code:
Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
Dim prodQty As Integer = QtyTextBox.Text
Dim StkOutQty As Integer = StockOutTextBox.Text
Dim results As Integer
results = prodQty - StkOutQty
QtyTextBox.Text = results
End Sub

You could also add code to update your data tables, or, if your form has a navigation bar, you could simply click the Save button. I hope this helps
 
Back
Top