以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  不重复加载数据代码出错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133458)

--  作者:ZJZK2018
--  发布时间:2019/4/14 23:47:00
--  不重复加载数据代码出错
下面追载数据代码是对的:

Dim str As String = DataTables("当年工资库").GetComboListString("_Identify")

Dim idxs As String = str.Replace("|","\',\'")

Dim filt As String = "[_Identify] Not In (\'" & idxs & "\')"

DataTables("当年工资库").AppendLoad(filt)


但下面代码执行时,原有数据不见了,需求是效果跟上面代码一样,如何调整下面代码?
Dim str As String = DataTables("当年工资库").GetComboListString("_Identify")
Dim idxs As String = str.Replace("|","\',\'")
Dim filt As String = "[_Identify] Not In (\'" & idxs & "\')"

If DataTables("当年工资库").Find(filt) Is Nothing Then
    \'DataTables("当年工资库").LoadFilter = DataTables("当年工资库").LoadFilter
    DataTables("当年工资库").LoadFilter = filt
    DataTables("当年工资库").Load()
End If



--  作者:有点甜
--  发布时间:2019/4/15 10:02:00
--  

Dim str As String = DataTables("当年工资库").GetComboListString("_Identify")
Dim idxs As String = str.Replace("|","\',\'")
Dim filt As String = "[_Identify] In (\'" & idxs & "\')"

DataTables("当年工资库").LoadFilter = iif(DataTables("当年工资库").LoadFilter>"", "(" & DataTables("当年工资库").LoadFilter & ") or " & filt, "")
DataTables("当年工资库").Load()