Dim filter As String = "" If e.Form.Controls("ComboBox1").text > "" Then filter = "仓库 = '" & e.Form.Controls("ComboBox1").text & "' " If e.Form.Controls("DateTimePicker1").text >"" Then filter =filter & " And 日期 >= #" & e.Form.Controls("DateTimePicker1").text & "# " If e.Form.Controls("DateTimePicker2").text >"" Then filter =filter & " And 日期 <= #" & e.Form.Controls("DateTimePicker2").text & "# " If e.Form.Controls("DropBox1").text >"" Then filter =filter & " And 品号 ='" & e.Form.Controls("DropBox1").text & "' " filter = filter.Trim If filter.StartsWith("And") Then filter = filter.SubString(3) Tables("台账查询_table1").Filter = filter
|