Dim n1 As Double = e.Form.Controls("NumericComboBox6").Text Dim n2 As Double = e.Form.Controls("TextBox4").Text If n1 <> "" Then If n1 >= n2 Then e.Form.Controls("NumericComboBox6").Error = "取量要小于余量!" Else e.Form.Controls("NumericComboBox6").Error = "" End If End If