给一个查询按钮设置如下事件代码,点击查询后出现附件图
此主题相关图片如下:捕获.png

主要问题是标红的部分,找不出问题所在,请大家帮忙!感谢!
Dim Filter As String
With e.Form.Controls("送检单位ComboBox1")
If .Value IsNot Nothing Then
Filter = " 送检单位 = '" & .Value & "'"
End If
End With
With e.Form.Controls("器具名称ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & " 器具名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("送检时间1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & " 送检登记日 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("送检时间2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & " 送检登记日 <= #" & .Value & "#"
End If
End With
With e.Form.Controls("器具编号textbox")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And 出厂(或自)编号 =" & .Value
End If
Filter = "出厂(或自)编号 =" & .Value
End If
End With
With DataTables("检测业务表")
.loadFilter = Filter
.load()
End With