以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  界面控件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=85629)

--  作者:狐狸爸爸
--  发布时间:2016/5/30 17:01:00
--  
If e.Form.Controls("DaPk1").Value Is Nothing Then
    e.Form.Controls("DaPk1").Value = "在岗"
Else
    e.Form.Controls("DaPk1").Value = "离岗"
End If
--  作者:狐狸爸爸
--  发布时间:2016/5/30 17:36:00
--  

上面的代码肯定不会有这个问题,请贴出你的完整代码。

或者用这个先自己分析一下:

http://www.foxtable.com/help/topics/1485.htm

 


--  作者:狐狸爸爸
--  发布时间:2016/5/30 18:30:00
--  

你这是绑定状态,应该用表事件:

http://www.foxtable.com/help/topics/0625.htm

http://www.foxtable.com/help/topics/1469.htm

http://www.foxtable.com/help/topics/1470.htm

 

TextBox绑定到列之后,不能直接设置值的:

http://www.foxtable.com/help/topics/2436.htm

 


--  作者:大红袍
--  发布时间:2016/5/30 18:38:00
--  

DataColChanged事件

 


If e.DataCol.name = "离岗时间" OrElse e.DataCol.name = "员工姓名" Then
    If e.DataRow.IsNull("员工姓名") Then
        e.DataRow("在岗状况") = Nothing
        e.DataRow("离岗时间") = Nothing
    Else
        If e.DataRow.IsNull("离岗时间") Then
            e.DataRow("在岗状况") = "在岗"
        Else
            e.DataRow("在岗状况") = "离岗"
        End If
    End If
End If