Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call Open_database()
XSQL = "Select stock from item where itemcode like '" & Trim(TextBox2.Text) & "'"
CMD = New OleDb.OleDbCommand(XSQL, CONN)
CMD.ExecuteReader()
If Missing Code Here
MsgBox("Alert")
Else
XSQL = "Update item set Stock = Stock - " & Trim(TextBox1.Text) & " where itemcode like '" & Trim(TextBox2.Text) & "' and stock > 0"
CMD = New OleDb.OleDbCommand(XSQL, CONN)
CMD.ExecuteNonQuery()
CMD.Dispose()
CONN.Close()
MsgBox("Alert", MsgBoxStyle.Information)
End Sub
hello..i might need some help here..i need to make a Condition where if my item is less than 0 then a msgbox will pop up...can any1 help me ? thx.