With e.DataRow("客户名称") IsNot Nothing
Dim d As Date =Date.now
e.DataRow("本期年度")=d.year
End With
Select Case e.DataCol.name
Case "客户名称","本期年度"
If e.DataRow("客户名称") IsNot Nothing AndAlso e.DataRow("本期年度") IsNot Nothing Then
Dim filter As String
filter = "客户名称 = '" & e.DataRow("客户名称") & "' and 年度= '" & e.DataRow("本期年度")-1 &"'"
Dim dr As DataRow=DataTables("结余历史数据").Find(filter)
If dr Is Nothing Then
messagebox.show("未找到该客户的结余数据,请手动填写或核实!","提示")
Return
Else
e.DataRow("上期结转_货款金额")= dr("账款结余")
e.DataRow("上期结转_货物数量")= dr("货物数量结余")
End If
End If
End Select
为何当年度自动输完后,没有找到相应数据,msgbox弹出来两次??