以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于修改记录保存的问题。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=86748)

--  作者:scofields
--  发布时间:2016/6/24 19:05:00
--  关于修改记录保存的问题。
红袍老师,这段代码是上次我在论坛上发现的,也是你写的,我恰好也缺,解决了我的一个大问题!想问一下,这段代码怎么改成每一个修改都能记录下来,而不是被其他修改给覆盖掉。

If e.DataCol.name <> "备注"  Then
    If e.DataRow.IsNull("备注") Then
        e.DataRow("备注") = Date.now & user.name 
    Else
        e.DataRow("备注") = vbcrlf & Date.now & " " & user.name & " 把【" & e.DataCol.Name & "】从\'" & e.OldValue & "\'修改成 \'" & e.NewValue & "\'"
    End If
End If

--  作者:Hyphen
--  发布时间:2016/6/25 8:41:00
--  
没有把原来的代码抄完整吧

If e.DataCol.name <> "备注"  Then
    If e.DataRow.IsNull("备注") Then
        e.DataRow("备注") = Date.now & user.name 
    Else
        e.DataRow("备注") &= vbcrlf & Date.now & " " & user.name & " 把【" & e.DataCol.Name & "】从\'" & e.OldValue & "\'修改成 \'" & e.NewValue & "\'"
    End If
End If

--  作者:scofields
--  发布时间:2016/6/25 11:15:00
--  
感谢,问题已解决一般!但还是有一个问题,就是我想实现修改的时候才有记录,新增行不需要有这个记录。这可怎么修改?



--  作者:Hyphen
--  发布时间:2016/6/25 11:39:00
--  
参考http://www.foxtable.com/help/topics/0428.htm