这样看看
If e.DataCol.name = "quantity"
Dim po As String = e.DataRow("PO")
Dim ty As String = e.DataRow("material_type")
Dim name As String = e.DataRow("material_name")
Dim size As String = e.DataRow("material_size")
Dim color As String = e.DataRow("color")
Dim pdr As DataRow = DataTables("库存表").Find("PO = '" & po & "' And material_type = '" & ty & "' And material_name = '" & name & "' And material_size = '" & size & "' And material_color = '" & color & "'")
if pdr Isnot Nothing Then
If pdr("stocking_qty") < e.NewValue Then
MessageBox.Show("库存不足")
End If
else
MessageBox.Show("没有符合条件的数据")
End If