Dim sl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1") If sl.text = "0" OrElse sl.text = "" Then msgbox("请输入出库数量!") '首先出库数量不能为0 Return End If
或者这样写
Dim sl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1") If val(sl.text) = 0 Then msgbox("请输入出库数量!") '首先出库数量不能为0 Return End If