Dim cbx1 As WinForm.ComboBox = e.Form.Controls("ComboBox1") Dim cbx2 As WinForm.ComboBox = e.Form.Controls("ComboBox2") Dim filter As String = "1=1" If cbx1.text > "" Then Dim year As String = cbx1.text.SubString(0,2) Dim month As String = cbx1.text.SubString(3,2) Dim d As Date = new Date(year+2000, month, 1) filter &= " and 量房时间 >= #" & d & "# and 量房时间 < #" & d.AddMonths(1) & "#" End If If cbx2.text > "" Then filter &= " and 设计师 = '" & cbx2.text & "'" End If 'msgbox(filter) e.Form.controls("table1").Table.Filter = filter
|