以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 逻辑自动复制行,删除行 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=129651) |
-- 作者:nmxmnxf -- 发布时间:2019/1/3 11:04:00 -- 逻辑自动复制行,删除行 If e.DataCol.Name = "加入台帐" AndAlso e.DataRow("加入台帐") = True Then Dim nma() As String = {"记录编号","巡查日期","巡查项目","巡查线路","发现违法情况","备注"} \'A表数据来源列 Dim nmb() As String = {"记录编号","巡查日期","巡查内容","巡查路线","发现违法情况","备注"} \'B表数据接收列 Dim dr As DataRow = DataTables("巡查台帐").AddNew For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next End If 以上代码可以实现逻辑复制行到台帐表,但如何实现逻辑列由true 变为false时再删除巡查台帐中刚新增的行?看论坛上有同样的贴子,但加入那行代码,不成功,希望帮助写下代码。急等中..........
|
-- 作者:有点甜 -- 发布时间:2019/1/3 11:27:00 -- If e.DataCol.Name = "加入台帐" Then If e.DataRow("加入台帐") = True Then Dim nma() As String = {"记录编号","巡查日期","巡查项目","巡查线路","发现违法情况","备注"} \'A表数据来源列 Dim nmb() As String = {"记录编号","巡查日期","巡查内容","巡查路线","发现违法情况","备注"} \'B表数据接收列 Dim dr As DataRow = DataTables("巡查台帐").AddNew For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next Else DataTables("巡查台帐").deletefor("记录编号=\'" & e.DataRow("记录编号") & "\'") End If End If |
-- 作者:nmxmnxf -- 发布时间:2019/1/3 11:32:00 -- 完美解决,非常感谢 完美解决,非常感谢!!! |