那你就这样写
If e.DataCol.name = "shuliang" Then
Dim t As Table = Tables("weixindanhao.weixin.weixinminxi")
Dim cc As Integer = e.DataRow("shuliang")
Dim rks1 As Double = DataTables("minxi").sqlCompute("max(leiji)", "name = '" & e.DataRow("name") & "'")
Dim cks As Double = DataTables("weixinminxi").sqlCompute("max(leiji)", "name = '" & e.DataRow("name") & "'")
If rks1 - cks >=0 Then
SystemReady = false
For i As Integer = t.rows.count-1 To 0 Step -1
t.rows(i).delete
Next
t.addnew(cc)
t.save()
SystemReady = true
Else
e.Cancel = True
msgbox("无法出库,库存不足")
End If
End If