Dim Filter As String
With e.Form.Controls("bmdaima")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(单位代码, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("供应商名称")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(供应商名称, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(物料名称, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(订购状态, 'System.String') like '%" & .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 & "convert(仓库代码, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "请购日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "请购日期 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("请购需求管理_Table1").Filter =Filter & "申请状态 = '已批准'"
End If
在操作时,提示”申请状态“后面缺运算符后缺少操作数,请问代码应如何修改?