Dim Filter As String = "[报告编号] <> '' and [报告编号] is not null "
With e.Form.Controls("combobox6")
If .Value IsNot Nothing Then
Filter = Filter & " and 检测部门 = '" & .Value & "'"
End If
End With
With e.Form.Controls("dtp7")
If .Value IsNot Nothing Then
Filter = Filter & " and 报告日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("dtp8")
If .Value IsNot Nothing Then
Filter = Filter & " and 报告日期 <= #" & .Value & "#"
End If
End With
Dim txt As String = e.Form.Controls("TextBox12").Text
If txt > "" Then
txt = "'%" & txt & "%'"
Filter = Filter & "and 委托单位 Like " & txt & " "
End If
Tables("form_table5").Filter = Filter