请教一个问题:写了一段查询加载代码,但显示‘#’附近有语法错误,我将最后的filter弹屏出来,但未发现异常?
Dim Filter As String
With e.Form.Controls("xm")
If .Value IsNot Nothing Then
Filter = "[姓名] = '" & .Value & "'"
End If
End With
With e.Form.Controls("sd")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "[日期] >= #" & .Value & "#"
End If
End With
With e.Form.Controls("ed")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "[日期] <= #" & .Value & "#"
End If
End With
messagebox.show(filter)
If Filter >""
DataTables("考勤记录").loadFilter = Filter
DataTables("考勤记录").LoadOrder = "姓名,日期 Desc"
DataTables("考勤记录").Load
End If

此主题相关图片如下:捕获.jpg