If e.DataCol.name="name" Then
Dim dr As DataRow = Tables("weixindanhao.weixin").DataTable.Find("name = '" & e.NewValue & "'")
If dr IsNot Nothing Then
msgbox("已存在")
dr("shuliang") += 1
r.delete
Else
dr = DataTables("product").Find("[shangpinming] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
e.DataRow("cord") = dr("cord")
e.DataRow("markprice") = dr("markprice")
e.DataRow("price") = dr("sellprice")
e.DataRow("kg") = dr("kg")
e.DataRow("name") = dr("shangpinming")
Else
messagebox.show("没有此商品 请在入库单先入库")
forms("商品").open
End If
End If
End If