以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  纠结啊 父表与子表同步加载 代码执行一直出现错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=28154)

--  作者:superman430
--  发布时间:2013/1/20 22:38:00
--  纠结啊 父表与子表同步加载 代码执行一直出现错误

If DataTables("业务表").DataRows.Count = 0 Then
DataTables("诉讼表").LoadFilter = "[业务编号] Is Null"

DataTables("非诉表").LoadFilter = "[业务编号] Is Null"
DataTables("费用表").LoadFilter = "[业务编号] Is Null"

DataTables("发票表").LoadFilter = "[业务编号] Is Null"
DataTables("日程表").LoadFilter = "[业务编号] Is Null"

Else    
Dim ids As String
For Each dr As DataRow In DataTables("业务表").DataRows
    ids = ids & "," & dr("业务编号")
Next
ids= ids.Trim(",")
DataTables("诉讼表").LoadFilter = "[业务编号] In (" & ids & ")"
DataTables("非诉表").LoadFilter = "[业务编号] In (" & ids & ")"
DataTables("费用表").LoadFilter = "[业务编号] In (" & ids & ")"
DataTables("发票表").LoadFilter = "[业务编号] In (" & ids & ")"
DataTables("日程表").LoadFilter = "[业务编号] In (" & ids & ")"
End If
DataTables("诉讼表").Load()
DataTables("非诉表").Load()
DataTables("费用表").Load()
DataTables("发票表").Load()
DataTables("日程表").Load()

 

 

执行以上代码 连续提示5个错误【至少一个值未引用】。。。。  不理解啊 不理解 求教


--  作者:superman430
--  发布时间:2013/1/21 0:28:00
--  
求狐爸指点
--  作者:程兴刚
--  发布时间:2013/1/21 0:52:00
--  

If DataTables("业务表").DataRows.Count = 0 Then
    DataTables("诉讼表").LoadFilter = "[业务编号] Is Null"

    DataTables("非诉表").LoadFilter = "[业务编号] Is Null"
    DataTables("费用表").LoadFilter = "[业务编号] Is Null"

    DataTables("发票表").LoadFilter = "[业务编号] Is Null"
    DataTables("日程表").LoadFilter = "[业务编号] Is Null"

Else 
    Dim ids As String = "\'"
    For Each dr As DataRow In DataTables("业务表").DataRows
         ids = ids & "\',\'" & dr("业务编号") & "\'"
    Next
    DataTables("诉讼表").LoadFilter = "[业务编号] In (" & ids & ")"
    DataTables("非诉表").LoadFilter = "[业务编号] In (" & ids & ")"
    DataTables("费用表").LoadFilter = "[业务编号] In (" & ids & ")"
    DataTables("发票表").LoadFilter = "[业务编号] In (" & ids & ")"
    DataTables("日程表").LoadFilter = "[业务编号] In (" & ids & ")"
End If

DataTables("诉讼表").Load()
DataTables("非诉表").Load()
DataTables("费用表").Load()
DataTables("发票表").Load()
DataTables("日程表").Load()