Dim d1 As Date = e.Form.Controls("DateTimePicker1").Value If d1 = Nothing Then d1 = Date.Today Dim filter1 As String = "1=1" If e.Form.Controls("RadioButton1").Checked Then filter1 = " and 发货_日期 = #" & d1 & "#" ElseIf e.Form.Controls("RadioButton2").Checked Then Dim w As Integer = d1.DayOfWeek '算出今天是星期几 Dim dt1 As Date = d1.AddDays(0 - w) '获取本周的第一天 ,星期一到星期天 Dim dt2 As Date = d1.AddDays(6 - w) '获取本周的最后一天 filter1 = " and 发货_日期 >= #" & dt1 & "# and 发货_日期 <= #" & dt2 & "#" End If If e.form.Controls("ComboBox2").Text > "" Then filter1 = filter1 & " And 目录_订单= '" & e.form.Controls("ComboBox2").Text & "'" End If Tables("订单").Filter = filter1
|