View Full Version : Apply/Remove Filter Help


LQ
04-11-2001, 10:04 AM
Is there a way to put a button on a form for Apply/Remove Filter? I want users (who are not at all Access-savvy) to be able to Filter By Form without having to go up to the toolbar. I figured out a way to make a command button for Filter By Form, but the problem is that once you press this button and enter criteria, you still have to go up to the toolbar and click on Apply Filter. I tried, with my very limited vba skills, to create a command button for Apply Filter on the form itself, but when you press the Filter By Form button I created, which you have to do first so you can enter search criteria, my other command buttons get grayed out. Will my database users just have to learn how to go up to the toolbar to Apply or Remove their filters?

Thanks in advance for any advice/help!

KevinM
04-12-2001, 01:12 AM
Try using the line....

Docmd.FilterOn=False

Put it somwehere before the filter by form kicks in.

HTH

LQ
04-16-2001, 04:13 AM
I tried doing this, and either I am putting the code in the wrong place (which could definitely be the case), or it's just not working. I am not sure I understand what the code is trying to do. Any further help would be greatly appreciated!

Thanks