With Tables("外协加工纱线明细") Dim Filter As String = "1=1" If .Current("外协领料_领料日期1") = Nothing Then Filter = Filter & " and 操作日期 is null " Else Filter = Filter & " and 操作日期 = '" & .Current("外协领料_领料日期1") & "' " End If If .Current("纱线名称") = Nothing Then Filter = Filter & " and 原料用途 is null" Else Filter = Filter & " and 原料用途 = '" & .Current("纱线名称") & "'" End If
If Filter > "" Then Tables("外协纺纱领料记录_Table1").Filter = Filter End If End With