求助!!!access VBA代码提示操作符丢失
代码如下:
Private Sub CMD查询_Click()
Dim strWhere As String
strWhere = ""
If Not IsNull(Me.编号) Then
strWhere = strWhere & "([编号] like '*" & Me.编号 & "*') AND "
End If
If Not IsNull(Me.所属乡镇) Then
strWhere = strWhere & "([所属乡镇] like '*" & Me.所属乡镇 & "*') AND "
End If
If Not IsNull(Me.经度) Then
strWhere = strWhere & "([经度] like '*" & Me.经度 & "*') AND "
End If
If Not IsNull(Me.设备种类) Then
strWhere = strWhere & "([设备种类] like '*" & Me.设备种类 & "*') AND "
End If
If Not IsNull(Me.建设时间) Then
strWhere = strWhere & "([建设时间] like '" & Me.建设时间 & "') AND "
End If
If Not IsNull(Me.纬度) Then
strWhere = strWhere & "([纬度] like '" & Me.纬度 & "') AND "
End If
If Not IsNull(Me.位置1) Then
strWhere = strWhere & "([位置1] like '" & Me.位置1 & "') AND "
End If
If Not IsNull(Me.位置2) Then
strWhere = strWhere & "([位置2] like '" & Me.位置2 & "') AND "
End If
If Not IsNull(Me.道路名称修改备注) Then
strWhere = strWhere & "([道路名称修改备注] like '" & Me.道路名称修改备注 & "') AND "
End If
If Not IsNull(Me.点位名称) Then
strWhere = strWhere & "([点位名称] like '" & Me.点位名称 & "') AND "
End If
If Not IsNull(Me.所属中队) Then
strWhere = strWhere & "([所属中队] like '" & Me.所属中队 & "') AND "
End If
If Not IsNull(Me.建设单位) Then
strWhere = strWhere & "([建设单位] like '" & Me.建设单位 & "') AND "
End If
Debug.Print strWhere
Me.[总表子窗体].Form.Filter = strWhere
Me.[总表子窗体].Form.FilterOn = True
Exit_CMD查询_Click:
Exit Sub
Err_CMD查询_Click:
MsgBox Err.Description
Resume Exit_CMD查询_Click
End Sub