Dim sx As String = "1=1"
Dim sjsx As String = "1=1"
With e.Form.Controls("3ssk1")
If .Value IsNot Nothing Then
sx &= " and 物料名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("3ssk2")
If .Value IsNot Nothing Then
sx &= " and 型号规格 = '" & .Value & "'"
End If
End With
With e.Form.Controls("3dt1") ''开始时间
If .Value IsNot Nothing Then
sjsx &= " and 购进日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("3dt2") ''结束时间
If .Value IsNot Nothing Then
sjsx &= " and 购进日期 <= #" & .Value & "#"
End If
End With
Tables("单据查询_3tb1").Filter = sjsx
Dim str As String = DataTables("入库明细表").GetComboListString("购进单据号", sjsx).Replace("|", "','")
Tables("单据查询_3tb2").Filter = sx & " and 购进单据号 in ('" & str & "')"