开始筛选按钮设置如下代码,但是实现不了后台筛选,请老师指点
Dim Filter As String
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 e.Form.Controls("RadioButton5").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "乡镇审核 = True"
End If
If e.Form.Controls("RadioButton6").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "乡镇审核 = False Or 乡镇审核 Is Null"
End If
If e.Form.Controls("RadioButton2").Checked = True ' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否结算 = True"
End If
If e.Form.Controls("RadioButton3").Checked = True ' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "是否结算 = False Or 是否结算 Is Null"
End If
If Filter > "" Then
Tables("S征地记录").Filter = Filter
End If