http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50080
比如
If e.DataCol.Name = "出库数量" Then
Dim dr As DataRow
dr = DataTables("库存").Find("商品编号 = '" & e.datarow("商品编号") & "'")
If dr IsNot Nothing andalso dr("库存量") < e.newvalue Then
MessageBox.Show("库存量不足!")
e.Cancel = True
End If
End If