此主题相关图片如下:窗口.png
Dim Filter As String
With e.Form.Controls("商品名称")
If .Value IsNot Nothing Then
Filter = "商品名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("客户名称")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "客户名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("来源")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "来源 = '" & .Value & "'"
End If
End With
With e.Form.Controls("开始日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("结束日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If e.Form.Controls("已付").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "已付款 = True"
End If
If e.Form.Controls("未付").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "已付款 = False Or 已付款 Is Null"
End If
If Filter > "" Then
Tables("蓝峰管理_Table3").Filter = Filter
End If
谢谢老师帮我修改一下上面的代码