Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
If txtDescription.Text = "" Then
MessageBox.Show("Description is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtDescription.Focus()
Exit Sub
End If
If IsNumeric(txtQuantity.Text) = False Then
MessageBox.Show("Quantity on hand must be an integer value >= zero.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtQuantity.Focus()
Exit Sub
End If
If Integer.Parse(txtQuantity.Text) < 0 Then
MessageBox.Show("Quantity on hand must be an integer value >= zero.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtQuantity.Focus()
Exit Sub
End If
If txtQuantity.Text = 0 And _
txtReorderDate.Text = "" = False Then
MessageBox.Show("Reorder date not used when quantity <> zero.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
txtQuantity.Focus()
Exit Sub
End If
|