'查看量房开始 Dim cbx1 As WinForm.ComboBox = e.Form.Controls("ComboBox5") Dim cbx2 As WinForm.ComboBox = e.Form.Controls("ComboBox6") Dim filter As String = "1=1" If cbx1.text > "" Then Dim year As String = cbx1.text.SubString(0,2) Dim week As String = cbx1.text.SubString(3,2) Dim d As Date = new Date(year+2000, 1, 1) Dim w = d.DayOfWeek Dim startdate As Date Dim Enddate As Date Select Case week Case "01" startdate = d Enddate = d.AddDays(7-w) Case "53" startdate = d.AddDays(7-w).AddDays(7*51) Enddate = d.AddYears(1) Case Else startdate = d.AddDays(7-w).AddDays(7*(val(week)-2)) Enddate = startdate.AddDays(7) End Select msgbox(startdate & "-" & Enddate ) filter &= " and 量房时间 >= #" & startdate & "# and 量房时间 < #" & Enddate & "#" End If If cbx2.text > "" Then filter &= " and 设计师 = '" & cbx2.text & "'" End If 'msgbox(filter) e.Form.controls("table1").Table.Filter = filter '查看量房结束
|