以文本方式查看主题

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

--  作者:cyrollin
--  发布时间:2018/10/24 11:30:00
--  甜甜老师,求助
If e.DataCol.name = "日期" Then
    If e.newvalue = True Then
        e.DataRow("班期") = "变更"
    End If
End If

错误:

.NET Framework 版本:2.0.50727.8825
Foxtable 版本:2018.9.9.1
错误所在事件:表A,表A,DataColChanged
详细错误信息:
调用的目标发生了异常。
没有为 类型“Date” 和 类型“Boolean” 定义运算符“=”。

--  作者:有点甜
--  发布时间:2018/10/24 11:40:00
--  
If e.DataCol.name = "日期" Then
    If e.newvalue <> Nothing Then
        e.DataRow("班期") = "变更"
    End If
End If

--  作者:cyrollin
--  发布时间:2018/10/24 11:47:00
--  
谢谢, 吃饭了吗,甜甜
[此贴子已经被作者于2018/10/24 11:48:07编辑过]

--  作者:cyrollin
--  发布时间:2018/10/24 11:55:00
--  
If e.DataCol.name = "日期" Then
    If e.newvalue <> Nothing Then  ‘ 这列有日期,当改成新的日期,然后执行下面代码,好象不可以。
        e.DataRow("班期") = "变更"
    End If
End If

好象不能实现哦, 

--  作者:有点甜
--  发布时间:2018/10/24 12:00:00
--  
If e.DataCol.name = "日期" Then
    If e.oldvalue <> nothing andalso e.newvalue <> Nothing Then 
        e.DataRow("班期") = "变更"
    End If
End If

--  作者:cyrollin
--  发布时间:2018/10/25 10:25:00
--  
哦,这个代码不能写在 currentchanged事件里面啊? 如果放里面, 会出现 newvalue 不是tableeventargs的成员。
--  作者:有点蓝
--  发布时间:2018/10/25 10:35:00
--  
不能写在 currentchanged事件
--  作者:cyrollin
--  发布时间:2018/10/25 11:37:00
--  
If e.DataCol.name = "日期" Then   
   If e.oldvalue <> Nothing And e.newvalue <> Nothing Then 
     e.DataRow("班期") = "变更"
  Tables("表A").Current.Move(-1)  ’然后把此行移动到最后一行,提示在排序状态下不能移动行,有其他操作方法吗?
    End If
End If

难道在此句前后加上 不排序,再排序的语句吗? 这样会出现跳跃,不想实现象刷新一样的效果。
[此贴子已经被作者于2018/10/25 11:38:59编辑过]

--  作者:有点蓝
--  发布时间:2018/10/25 11:40:00
--  
在排序状态下不能移动行。要么取消排序,要么不要移动