1、去看你的BeforeCloseProject事件,路径一定要存在。而且要有权限写入文件;
2、销售单datacolchanged事件,一定要判断列名啊
If e.DataCol.Name = "xiadantime" Then
If e.DataRow.IsNull("xiadantime") Then
e.DataRow("xiaoshoudan") = Nothing
Else
Dim bh As String ="销售" & Format(e.DataRow("xiadantime"),"yyyyMMddhhmmss") '取得xiaoshoudan的8位前缀
e.DataRow("xiaoshoudan") = bh
' End If
End If
End If
Select Case e.DataCol.name
Case "yishou","tajin","huilv"
If e.DataRow.IsNull("yishou") Then
e.DataRow("zhuan")=e.DataRow("tajin") / e.DataRow("huilv")
Else e.DataRow("zhuan")= (e.DataRow("tajin") - e.DataRow("yishou")) /e.DataRow("huilv")
End If
End Select