以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]窗口权限换行后无效的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=174787)

--  作者:13636623313
--  发布时间:2022/2/5 18:18:00
--  [求助]窗口权限换行后无效的问题
我在窗口AfterLoad事件设定了编辑权限:

\'只有开发者能勾选
If User.Name <> "开发者" Then
    e.Form.Controls("CheckBox1").Enabled = False
End If

\'已勾选的禁止编辑
If Tables("project_a01").Current("d01") = True Then
    e.Form.Controls("TextBox14").ReadOnly = BooleanEnum.True
End If

窗口中还有按钮,按钮的Click事件设定了换行:

With Tables("project_a01")
    If .Current IsNot Nothing AndAlso .Current.DataRow.RowState = DataRowState.Unchanged Then \'如果当前行未曾修改
        .Position = .Position - 1
    End If
End With

问题是,一旦点击换行,权限设置就会沿用最初点开一行的,不能刷新,如何处理?

--  作者:有点蓝
--  发布时间:2022/2/6 10:31:00
--  
表格currentchanged事件

if e.table.current isnot nothing andalso forms("某窗口").opened then
if e.table.current("d01") = True
forms("某窗口").Controls("TextBox14").ReadOnly = BooleanEnum.True
else
forms("某窗口").Controls("TextBox14").ReadOnly = BooleanEnum.false
en dif
endif