Dim r As Row = Tables("表a").Current
If r("编辑者") = User.Name Then '如果编辑者是当前用户
Return
End If
Dim cmd As New SQLCommand
Dim exp As String = "编辑者 Is Null And [_Identify] = " & r("_Identify")
cmd.CommandText = "Update {员工} Set 编辑者 = '" & User.Name & "' Where " & exp
If cmd.ExecuteNonQuery = 1 Then
r("编辑者") = User.Name
r.Save()
Forms("编辑窗口").Open()
Else
cmd.CommandText = "Select 编辑者 From {员工} Where [_Identify] = " & r("_Identify")
Dim nm As String = cmd.ExecuteScalar
If nm > "" Then
MessageBox.show(nm & "正在编辑此行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
MessageBox.show("此行可能已经被删除,无法编辑!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If