以文本方式查看主题

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

--  作者:爱相随
--  发布时间:2019/1/15 14:47:00
--  贷码不计算也不提示错误
老师,下面代码分别是从基础表中统计汇总月本数、本年数、以前合计,可是设置代码后并不计算也不提示错误,请老师帮忙看一下是怎么回事??

If e.DataCol.Name = "债务编码" Then  
    Dim filter1 As String = "债务编码 = \'" & e.DataRow("债务编码")  & "\' And 年度 = \'" & e.DataRow("年度") & "\'And 月份 = \'" & e.DataRow("月份") & "\'"
    e.DataRow("本月举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter1 ) 
    e.DataRow("本月偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter1 ) 
    e.DataRow("本月支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter1 ) 
End If

If e.DataCol.Name = "债务编码" Then  
    Dim filter2 As String = "债务编码 = \'" & e.DataRow("债务编码")  & "\' And 年度 = \'" & e.DataRow("年度") & "\'And 月份 <= \'" & e.DataRow("月份") & "\'"
    e.DataRow("本年举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter2 )    
    e.DataRow("本年偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter2 ) 
    e.DataRow("本年支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter2 )                        
End If

If e.DataCol.Name = "债务编码" Then  
    Dim filter3 As String = "债务编码 = \'" & e.DataRow("债务编码")  & "\' And 年度 < \'" & e.DataRow("年度") & "\'"
    e.DataRow("以前年度举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter3 )  
    e.DataRow("以前年度还本") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter3 ) 
    e.DataRow("以前支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter3 )                                       
End If

--  作者:爱相随
--  发布时间:2019/1/15 14:57:00
--  
代码没错,是窗口刷新按钮的代码有问题:
下面这段代码要指定具体的列名,请问代码怎么修改呢,谢谢老师
If CurrentTable IsNot Nothing AndAlso CurrentTable.ColSel >= 0 Then
    Dim dc As DataCol = CurrentTable.Cols(CurrentTable.ColSel).DataCol
    dc.RaiseDataColchanged()
End If
具体的列名是“债务编码”

--  作者:有点甜
--  发布时间:2019/1/15 16:34:00
--  

比如


    Dim dc As DataCol = DataTables("表A").DataCols("债务编码")
    dc.RaiseDataColchanged()