Private Sub AddStocksInUpdating() If txtItemNo.Text = "" Then MsgBox("Please select item to add stocks.", MsgBoxStyle.Critical, "Select Item") Exit Sub End If Dim strStocksIn As String strStocksIn = InputBox("Enter number of items : ", "Stocks In") txtQuantity.Text = Val(txtQuantity.Text) + Val(strStocksIn) Try sqL = "INSERT INTO StocksIn(ItemNo, ItemQuantity, SIDate, CurrentStocks) VALUES('" & txtItemNo.Text & "', '" & strStocksIn & "', '" & Format(Date.Now, "Short Date") & "', " & txtQuantity.Text & ")" ConnDB() cmd = New OleDbCommand(sqL, conn) Dim i As Integer i = cmd.ExecuteNonQuery() If i > 0 Then MsgBox("Stocks added successfully", MsgBoxStyle.Information, "Stocks In") Updateproduct() End If Catch ex As Exception MsgBox(ex.Message) Finally cmd.Dispose() conn.Close() End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)