Dim Filter As String
'With e.Form.Controls("cmbProduct")
' If .Value IsNot Nothing Then
' Filter = "供应商名称 = '" & .Value & "'"
' End If
'End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
End If
End With
If e.Form.Controls("rdoYifu").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "已付款 = True"
End If
If e.Form.Controls("rdoWeifu").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "已付款 = False Or 已付款 Is Null"
End If
If Filter > "" Then
Tables("采购汇总表_Table1").Filter = Filter
End If
Tables("采购汇总表_Table1").Cols("金额").GrandTotal = True '合计
Tables("采购汇总表_Table1").GrandTotal = True
在这个查询的基础上继续使用下面代码筛选,怎么可以组合起来
Dim txt As String = e.Form.Controls("TextBox2").Text
Dim tbl As Table = Tables("采购汇总表_Table1")
If txt = "" Then
tbl.Filter = ""
Else
txt = "'%" & txt & "%'"
tbl.Filter = "货品名称 Like " & txt & " Or 仓库 Like " & txt & " Or 规格 Like " & txt & " Or 供应商名称 Like " & txt & " Or 条形码 Like " & txt
End If