以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  窗口控件代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=131775)

--  作者:爱相随
--  发布时间:2019/3/6 13:21:00
--  窗口控件代码
老师,下列代码为窗口中的控件代码,如何才能正确,请老师指点,谢谢!!
For Each r As Row In DataTables("会计科目1")
        DataTables("会计科目3").datarows.clear
        Dim f As New Filler
        f.SourceTable = DataTables("会计科目1") \'指定数据来源
        f.SourceCols = "科目代码,科目名称,辅助类型" \'指定数据来源列
        f.DataTable = DataTables("会计科目3") \'指定数据接收表
        f.DataCols = "科目代码,科目名称,辅助类型" \'指定数据接收列
        f.ExcludeExistValue = True
        f.Fill() \'填充数据
Next


--  作者:y2287958
--  发布时间:2019/3/6 14:03:00
--  
DataTables("会计科目3").datarows.clear
Dim f As New Filler
f.SourceTable = DataTables("会计科目1") \'指定数据来源
f.DataTable = DataTables("会计科目3") \'指定数据接收表
f.ExcludeExistValue = True
f.Fill() \'填充数据

请说明目的

--  作者:有点甜
--  发布时间:2019/3/6 14:33:00
--  

直接写

 

DataTables("会计科目3").datarows.clear
Dim f As New Filler
f.SourceTable = DataTables("会计科目1") \'指定数据来源
f.SourceCols = "科目代码,科目名称,辅助类型" \'指定数据来源列
f.DataTable = DataTables("会计科目3") \'指定数据接收表
f.DataCols = "科目代码,科目名称,辅助类型" \'指定数据接收列
f.ExcludeExistValue = True
f.Fill() \'填充数据


--  作者:爱相随
--  发布时间:2019/3/6 14:37:00
--  
当点击窗口中此按钮时,清除表“会计科目3”原来的内容并将表“会计科目1”的“科目代码、科目名称、辅助类型”列的内容填充到表“会计科目3”的“科目代码、科目名称、辅助类型”列。再增加条件,如果表“会计科目3”的列“已启用”为是时,本按钮无效,并提示“会计科目已启用,不能再更改”。
--  作者:有点甜
--  发布时间:2019/3/6 14:43:00
--  

If Tables("会计科目3").current IsNot Nothing AndAlso Tables("会计科目3").current("已启用") = True Then
    msgbox("不能修改")
Else
    DataTables("会计科目3").datarows.clear
    Dim f As New Filler
    f.SourceTable = DataTables("会计科目1") \'指定数据来源
    f.SourceCols = "科目代码,科目名称,辅助类型" \'指定数据来源列
    f.DataTable = DataTables("会计科目3") \'指定数据接收表
    f.DataCols = "科目代码,科目名称,辅助类型" \'指定数据接收列
    f.ExcludeExistValue = True
    f.Fill() \'填充数据   
End If


--  作者:爱相随
--  发布时间:2019/3/6 15:48:00
--  
非常感谢老师的指导!!