以文本方式查看主题

-  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=117651)

--  作者:aza520
--  发布时间:2018/4/16 21:38:00
--  按钮使用问题
老师,我在征地明细表的CurrentChanged事件设了如下代码:

If Forms("征地记录").opened AndAlso e.Table.current IsNot Nothing Then

    Forms("征地记录").controls("button2").enabled = Not e.Table.current("是否结算")

    Forms("征地记录").controls("button3").enabled = Not e.Table.current("是否结算")

    Forms("征地记录").controls("button4").enabled = Not e.Table.current("是否结算")

End If


当是否结算列勾选是,禁用2、3、4按钮,但我新增行后,想要编辑时,按钮也不可用,该如何解决?



此主题相关图片如下:3333.png
按此在新窗口浏览图片


--  作者:有点蓝
--  发布时间:2018/4/16 21:46:00
--  
新增用table.addnew,不要使用datatable.addnew
--  作者:aza520
--  发布时间:2018/4/16 21:50:00
--  
我增加行的代码是:
Tables("S征地记录").AddNew()

--  作者:有点蓝
--  发布时间:2018/4/16 22:00:00
--  

If Forms("征地记录").opened AndAlso e.Table.current IsNot Nothing Then

msgbox(e.Table.current("是否结算")) \'新增行后这里能不能弹出来

    Forms("征地记录").controls("button2").enabled = Not e.Table.current("是否结算")

    Forms("征地记录").controls("button3").enabled = Not e.Table.current("是否结算")

    Forms("征地记录").controls("button4").enabled = Not e.Table.current("是否结算")

msgbox(Forms("征地记录").controls("button2").enabled )

End If


--  作者:aza520
--  发布时间:2018/4/16 22:05:00
--  
不能
--  作者:aza520
--  发布时间:2018/4/16 22:08:00
--  
选择原来的行可以弹出
--  作者:有点蓝
--  发布时间:2018/4/16 22:30:00
--  
如果是副本,代码放到窗口的表CurrentChanged事件
--  作者:aza520
--  发布时间:2018/4/16 22:36:00
--  
不是副本
--  作者:aza520
--  发布时间:2018/4/16 22:40:00
--  
老师,可以了,是要放到父表的事件里