1、
If e.DataCol.name ="文件序号" Then
Dim dr As DataRow=e.DataRow
If dr.Isnull("文号前缀") Then
MessageBox.Show("文号前缀和文件年号不能为空值!", "提示")
e.Cancel = True
End If
'Else
Dim qz As String = e.DataRow("文号前缀")
Dim nh As String = e.DataRow("年号")
Dim xh As String = e.DataRow("文件序号")
Dim wh As String = qz & "【" & nh & "】" & xh & "号"
MessageBox.show(wh)
Dim dr1 As DataRow = e.DataTable.Find("文号 = '" & wh & "'")
systemready = False
If dr1 IsNot Nothing Then
MessageBox.Show("此文号已经存在!")
e.DataRow("文件序号") = Nothing
e.Cancel = True
'ElseIf dr Is Nothing Then
Else
e.DataRow("文号") = qz & "【" & nh & "】" & xh & "号"
'e.DataRow("登记人") = _username
'e.DataRow("登记时间") = Date.now
End If
systemready = True
End If
2、
e.cancel = True
Forms("文件登记").Open()