473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can each next filter be added to previous filters by clicking filter button on a

1
Hi there!
I have a form where I have buttons that apply filter to a certain column.
How do I enable multiple filters where I can click more than 1 filter button and it keeps the filters?

First filter button:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. DoCmd.ApplyFilter "Filter1", "[MyQuery]![Checkbox1]=Yes", ""
  3. End Sub
Second filter button:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command2_Click()
  2. DoCmd.ApplyFilter "Filter2", "[MyQuery]![Checkbox2]=Yes", ""
  3. End Sub
Third filter button:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command3_Click()
  2. DoCmd.ApplyFilter "Filter3", "[MyQuery]![Checkbox3]=Yes", ""
  3. End Sub
It works well, but one by one.
How can each next filter be added to previous filters by clicking filter button on a form?
Thanks!
Apr 17 '15 #1
2 895
Seth Schrock
2,965 Expert 2GB
I would add three checkboxes to your form that are unbound. Each one would represent a filter. Then you would just have one button that would apply a filter based on which checkboxes are checked.
Apr 17 '15 #2
zmbd
5,501 Expert Mod 4TB
just to build on Seth's idea... with check button, have a sub that reapplies your filter based on current state of the check-boxes called when the user toggles the state instead of the command button.
Apr 17 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: DD | last post by:
I have placed a Cmd Button FilterBySelection(FilterOn), An Cmd Button FilterOff When i FilterOff this works fine When i FilterOn to a new selection the Filter returns the values of the previous...
2
by: Patrik | last post by:
Hi, I cannot find the right way to write this code. I keep getting the error : Next without For Here's my code. For Each Choix In RapInd_Code.ItemsSelected S6 =...
6
by: pmud | last post by:
Hi, I have created a very simple ASP.NET application which has a couple of ImageButtons which go to different SQL reports on clicking them. I have used Response.Redirect to send the user to the ...
2
by: june hin via .NET 247 | last post by:
(Type your message here) Hi. Iam ahving some minor problems regarding for Each...Next. Ihave a form whcih contains a set of radiobuttons in a a groupbox. i have added a button and on clicking the...
6
by: Paul Furman | last post by:
I'm getting incorrect response when hitting the enter key instead of actually clicking the button on a form. It activates but the post data isn't being sent I think. The php generated page...
2
by: bhanuk | last post by:
how to get data from a textfile by clicking the button using vb6.0
1
by: Vidya A | last post by:
How to select a row in a grid view by clicking link button in asp.net with VB.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.