turn off/on applyfilter via checkbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following function that I apply to a form for an applyfilter.

Function filterHistory()

DoCmd.ApplyFilter "filterHistory", "[tbl_Dividend]![Ex_Div_Date]>Date()"

End Function

How can I turn the filter off/on via a checkbox.

Bruce
 
if true then
form.filteron=false
'in case filter does not work there will be no filter set
'you might want to use the form name to make sure it applies to that form.
'example Forms!formname.filter="filter"
'docmds work with what object is active or its form.
form.filter="filter" Or your function() 'SQL statement
form.filteron=true
else
form.filteron=false
endif
I guess you can use docmd.applyfilter but I think it applies without ability
to turn on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top