qt表datacolchanged事件,加上列名判断
If e.DataCol.name="ppp" Then 'AndAlso Tables("qt").Current IsNot Nothing
Dim d As Date = e.DataRow("time")
Dim bh As String = Format(D,"MMddhhmm")
Dim bh1 As String = Format(D,"yyMMdd")
e.DataRow("cord1")=e.DataRow("name") & bh & e.DataRow("_Identify")
e.DataRow("bh1")= bh1
e.DataRow("bh")= bh
e.DataRow("pic")="c:\pic\补货\" & bh1 & "\" & e.DataRow("cord1") & ".jpeg"
End If
If e.DataCol.name="bbb"
If Tables("qt").Current.IsNull("bbb") Then
Else
e.DataRow("pic")="c:\pic\补货\" & e.DataRow("bbb").Replace("/","\")
End If
End If
If e.DataCol.Name="shangcheng"
Dim dr As DataRow = DataTables("商城").Find("[lable] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
e.DataRow("fuzhu") = dr("fuzhu")
End If
End If
If e.DataCol.Name="name"
Dim dr As DataRow = DataTables("user").Find("[name] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
' e.DataRow("kehu") = dr("username")
e.DataRow("name") = dr("name")
e.DataRow("name1") = dr("name1")
e.DataRow("name2") = dr("name2")
Dim bh As String = Format(e.DataRow("time"),"yyyyMMddhhmmss") '取得rukucord的8位前缀
e.DataRow("cord") = e.DataRow("name") & bh & e.DataRow("_Identify") & "BUY"
Else
If dr Is Nothing Then
messagebox.show("没有此客户信息,请添加")
forms("用户").open
' e.Cancel=True
End If
End If
End If
If e.DataCol.name="shuliang"
If e.DataRow.IsNull("shuliang") Then
' e.DataRow("xiaoji") = Nothing
Else
e.DataRow("xiaoji") = e.DataRow("shuliang") * e.DataRow("price")
End If
End If