Dim Filter As String = "1=1 "
With e.Form.Controls("ComboBox1")
If .Text IsNot Nothing Then
Filter = Filter & " and 入库仓库 = '" & .Text & "'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Text IsNot Nothing Then
Filter = Filter & " and 入库方式 = '" & .Text & "'"
End If
End With
With e.Form.Controls("ComboBox3")
If .Text IsNot Nothing Then
Filter = Filter & " and 供应商 = '" & .Text & "'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
Filter = Filter & " and 入库日期 >= #" & .Text & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
Filter = Filter & " and 入库日期 <= #" & .Text & "#"
End If
End With
If e.Form.Controls("RadioButton1").Checked = True ' 如果点击状态选择了"按入库单"
Tables("入库单").Filter = Filter
End If
If e.Form.Controls("RadioButton2").Checked = True ' 如果点击状态选择了"按明细"
Tables("耗材入库查询汇总_入库明细查询").Filter = Filter
End If
If e.Form.Controls("RadioButton3").Checked = True ' 如果点击状态选择了"按明细汇总"
Tables("入库明细汇总").Filter = Filter
End If
If e.Form.Controls("RadioButton4").Checked = True ' 如果点击状态选择了"按供应商"
Tables("入库供应商").Filter = Filter
End If