以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  跨表填充消失了  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=95061)

--  作者:jamhuton
--  发布时间:2017/1/9 13:22:00
--  跨表填充消失了
Select Case e.DataCol.Name
    Case "收入","支出"
        Dim dr As DataRow
        Dim drs As List(of DataRow)
        dr = e.DataTable.Find("[_SortKey] < " & e.DataRow("_SortKey"), "[_SortKey] Desc") \'找出上一行
        If dr Is Nothing Then \'如果没有找到上一行,说明本行就是第一行
            e.DataRow("余额") = e.DataRow("收入") - e.DataRow("支出")
            dr = e.DataRow
        End If
        drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey"), "[_SortKey]")
        For i As Integer = 1 To drs.Count - 1 \'重算余下行的余额
            drs(i)("余额") = drs(i-1)("余额") + drs(i)("收入") - drs(i)("支出")
        Next
End Select

If e.DataCol.Name = "统计项目" Then
    If e.DataRow.isnull("统计项目") Then
        e.DataRow("核对") = False
    Else
        e.DataRow("核对") = True
    End If
End If
If e.DataCol.Name = "核对"
    If e.DataRow("核对") = True Then
        Dim dr As DataRow = DataTables("流水RMB").AddNew
        For Each dc As DataCol In DataTables("流水RMB").DataCols
            dr(dc.Name) = e.DataRow(dc.Name)
        Next
        dr("外表编号") = e.DataRow("_Identify")
    Else
        DataTables("流水RMB").deletefor("外表编号 = \'" & e.DataRow("_Identify") & "\'")
    End If
End If


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

1、保存退出,然后再次进入的时候只显示上面的10行,空白的,里面内容不见了。
2、我把源表的【核对】列去掉钩子,然后再打勾,又增加了10行

结果就是接收表无法保存,只能保存增加的行,无法保存数据。

[此贴子已经被作者于2017/1/9 13:27:17编辑过]

--  作者:有点色
--  发布时间:2017/1/9 14:09:00
--  

1、

 

http://www.foxtable.com/webhelp/scr/1813.htm

 

2、如果你的是外部表,应该是你控制了默认加载行数。


--  作者:jamhuton
--  发布时间:2017/1/9 14:40:00
--  
加载是全部的
会不会是我多个表填入到【流水RMB】造成的呢?

--  作者:有点色
--  发布时间:2017/1/9 15:38:00
--  

首先,你表格能否保存数据?你直接在数据源那里预览数据,看是不是真的只有10行。

 

同时,你多个表操作同一个表,那么列【外表编号】就不能直接用_Identify列,有可能重复,误删除了数据。你可以改成

 

dr("外表编号") = e.DataTable.Name & "_" & e.DataRow("_Identify")