此主题相关图片如下:qq图片20131105200601.jpg
如上图 筛选代码 如下
要求 如下:已审 未审 所有,这个所有 是指符合全面的条件 ,不知道怎么写
Dim Filter As String
With e.Form.Controls("pmname")
If .Value IsNot Nothing Then
Filter = "产品名称 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ckname")
If .Value IsNot Nothing Then
Filter = "仓库 = '" & .Value & "'"
End If
End With
With e.Form.Controls("khname")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = 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("rdo1").Checked = True
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "单据状态='已审核'"
End If
If e.Form.Controls("rdo2").Checked = True
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "单据状态<>'已审核' or 单据状态 is null"
End If
If Filter > "" Then
Tables("销售单明细").Filter = Filter
End If
If Tables("销售单明细").rows.count=0
Tables("销售单明细").GrandTotal = False
Else
Tables("销售单明细").Cols("匹数").GrandTotal = True
Tables("销售单明细").Cols("米数").GrandTotal = True
Tables("销售单明细").GrandTotal = True '显示合计模式
End If