Dim bsc As WinForm.ComboBox = e.Form.Controls("办事处")
Dim sykh As WinForm.ComboBox = e.Form.Controls("上游客户")
Dim ysdt As WinForm.TextBox = e.Form.Controls("运输动态")
Dim rwdh As WinForm.TextBox = e.Form.Controls("任务单号")
Dim ysdh As WinForm.TextBox = e.Form.Controls("运输单号")
Dim vinm As WinForm.TextBox = e.Form.Controls("VIN码")
Dim pp As WinForm.TextBox = e.Form.Controls("品牌")
Dim spc As WinForm.TextBox = e.Form.Controls("商品车")
Dim kssj As WinForm.DateTimePicker = e.Form.Controls("开始")
Dim zzsj As WinForm.DateTimePicker = e.Form.Controls("终止")
If kssj.Value IsNot Nothing And zzsj.Value IsNot Nothing Then
Tables("信息总表").Filter = "办事处 like '*" & bsc.Value & "*' and 上游客户 like '*" & sykh.Value & "*' and 运输动态 like '*" & ysdt.Text & "*'and 任务单号 Like '*" & rwdh.Text & "*'and 运输单号 Like '*" & ysdh.Text & "*'and VIN码 like '*" & vinm.Text & "*' and 品牌 like '*" & pp.Text & "*'and 商品车 like '*" & spc.Text & "*' and 计划下达时间 >= #" & kssj.Value & "# and 计划下达时间 <= #" & zzsj.Value & "#"
else
Tables("信息总表").Filter = "办事处 like '*" & bsc.Value & "*' and 上游客户 like '*" & sykh.Value & "*' and 运输动态 like '*" & ysdt.Text & "*'and 任务单号 Like '*" & rwdh.Text & "*'and 运输单号 Like '*" & ysdh.Text & "*'and VIN码 like '*" & vinm.Text & "*' and 品牌 like '*" & pp.Text & "*'and 商品车 like '*" & spc.Text & "*'"
end if