Dim filter As String = "" For Each dr As DataRow In drs filter &= " or 进货批次 = '" & dr("进货批次") & "'" Next if filter > "" then Tables("采购订单").Filter = filter.SubString(3) Else Tables("采购订单").Filter = "" End If
------------或者
Dim filter As String = "1=2" For Each dr As DataRow In drs filter &= " or 进货批次 = '" & dr("进货批次") & "'" Next Tables("采购订单").Filter = filter