473,385 Members | 1,311 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,385 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 894
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.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.