呵呵,你一行代码,居然汇集7、8个错误,也不容易做到的:
Dim mdd As WinForm.ComboBox = e.Form.Controls("目的地")
Dim sjr As WinForm.ComboBox = e.Form.Controls("收件人")
Dim qsrq As WinForm.DateTimePicker = e.Form.Controls("起始日期")
Dim zzrq As WinForm.DateTimePicker = e.Form.Controls("终止日期")
Dim ydh As WinForm.TextBox = e.Form.Controls("运单号")
Dim njm As WinForm.TextBox = e.Form.Controls("内件名")
Tables("快递信息").Filter = " 目的地 = '" & mdd.text & "' And 收件人 = '"& sjr.text & "' and 起始日期 >= # " & qsrq .Value & "# and 终止日期 <= # " & zzrq.value & "# and 运单号 like '*" & ydh.text & "*' and 内件名 like '*" & njm.Text & "* '"
提示:
1、你漏掉了很多&
2、对于电脑,“北京”和 “北京 ”是完全不同的,字符比较的时候,不要乱加空格
3、字符用单引号',日期用#,记得日期不是用'#
4、提醒一下,你这样必须输入所有条件才能查找,为啥不按帮助来依葫芦画瓢:
http://www.foxtable.com/help/topics/1058.htm