prepareedit事件if e.col.name = "第一列" then
if e.row("方向") <> “A”
e.cancel=true
end if
elseif e.col.name = "第二列" then
if e.row("方向") <> “B”
e.cancel=true
end if
else
e.cancel=true
end if
If e.Col.name = "第一列" AndAlso e.Row.IsNull("方向") = False Then
If e.Row("方向") <> "A" Then
e.cancel = True
End If
ElseIf e.Col.name = "第二列" AndAlso e.Row.IsNull("方向") = False Then
If e.Row("方向") <> "B" Then
e.cancel = True
End If
Else
e.cancel = True
End If
这个试一下,当方向为空时,都锁表。不是需求,如何解决?
需求:方向为空时表可编辑,如果方向为A时,第一列可编辑,第二列不可编辑,如果方向为B时,第二列可编辑,第一列不可编辑,