Dim Filter As String
Dim tbl As Table = e.Form.Controls("Table1").Table
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("表A").Filter =Filter
End If