Dim sf As WinForm.TextBox = e.Form.Controls("按地区查询")
Dim dwmc As WinForm.TextBox = e.Form.Controls("按单位查询")
Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("起始日期")
Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("结束日期")
If sf.Value IsNot Nothing Then
Tables("查询窗口_查询").Filter = "省份 Like '*" & sf.text & "*'"
End If
If dwmc.Value IsNot Nothing Then
Tables("查询窗口_查询").Filter = "单位名称 Like '*" & dwmc.text & "*'"
End If
Dim Filter As String
If ksrq.Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= '" & ksrq.Value.Date & "'"
End If
If jsrq.Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 < '" & jsrq.Value.Date.adddays(1) & "'"
End If