DataColChanging事件必须用e.NewValue
Select Case e.DataCol.name
Case "数量"
Dim dxs As DataRow = e.DataRow
Dim dis As DataRow
dis = DataTables("库存明细").Find("采购编号 = '" & dxs("采购编号") & "' and 产品名称 = '" & dxs("产品名称") & "'")
If dis IsNot Nothing Then
If dis("库存数量")<e.NewValue Then
MessageBox.Show("该价格的产品库存不足,")
e.cancel = True
End If
Else
msgbox("没找到对应的编号")
End If
End Select