Dim Filter As String
With e.Form.Controls("时间范围")
Dim xz As WinForm.ComboBox = e.Form.Controls("时间范围")
If xz.value = "今天"
Dim y As Integer = Date.Today.Year
Dim d As Date = Date.Today \'当前时间
Filter = "创建时间 = \'" & d & "\' And 创建时间 = \'" & d & "\'"
Tables("订单管理").Filter = Filter
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "创建时间 >= \'" & .Value & "\'"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "创建时间 <= \'" & .Value & "\'"
End If
End With
If Filter > "" Then
Tables("订单管理").Filter = Filter
End If