很简单,参考
http://www.foxtable.com/webhelp/scr/1058.htm
Dim pt As WinForm.ComboBox = e.Form.Controls("订单平台")
Dim cp As WinForm.ComboBox = e.Form.Controls("订购产品")
Dim sjhm As WinForm.TextBox = e.Form.Controls("手机号码")
Dim xm As WinForm.TextBox = e.Form.Controls("客户姓名")
Dim sj1 As WinForm.DateTimePicker = e.Form.Controls("起始时间")
Dim sj2 As WinForm.DateTimePicker = e.Form.Controls("结束时间")
Dim filter As String = "1=1"
If sj1.Value <> Nothing Then
filter &= " and 订单日期 >= #" & sj1.value & "#"
End If
If sj2.Value <> Nothing Then
filter &= " and 订单日期 <= #" & sj2.value & "#"
End If
If pt.Value <> Nothing Then
filter &= " and 订单平台 like '%" & pt.value & "%'"
End If
Tables("表B").Filter=filter