日期单独拿出来处理
dim f2 as string
Filter = "分类 = '" & e.Form.Controls("ComboBox1").Value & "'"
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
f2 = "缴费_月租_起计日期 <= #" & .Value & "# and 缴费_月租_止计日期 >=#" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If f2 > "" Then
f2 = Filter & " or "
End If
f2 = f2 & "缴费_月租_起计日期 <= #" & .Value & "# and 缴费_月租_止计日期 >= #" & .Value & "#"
End If
End With
if F2 > "" then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & " (" & F2 & ") "
end if
With e.Form.Controls("DropBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "车牌号码 = '" & .Value & "'"
End If
End With