473,659 Members | 2,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter on/off toggle

Hello everyone,

When I open this Form it displays all the records

I then use a command button to apply a filter to these records.

I would like to change the command buttom to a toggle switch that
would:
1. apply the filter when it is in the up position
2. remove the filter and show ALL the records when it is in the down
position.

I'm not having much luck. Any suggestions would be appreciated.

Dave
Nov 13 '05 #1
2 16477
In the Click event of the button and the Current event of the form you need
to check the value of the button (true or false, i.e. up or down) then use
and If..Then..Else statement to do what you want depending on the value of
the button. The button is True when pressed and False when up.

--
Wayne Morgan
MS Access MVP
"Dave White" <dj*****@snet.n et> wrote in message
news:mt******** *************** *********@4ax.c om...
Hello everyone,

When I open this Form it displays all the records

I then use a command button to apply a filter to these records.

I would like to change the command buttom to a toggle switch that
would:
1. apply the filter when it is in the up position
2. remove the filter and show ALL the records when it is in the down
position.

I'm not having much luck. Any suggestions would be appreciated.

Dave

Nov 13 '05 #2
Dave White wrote:
Hello everyone,

When I open this Form it displays all the records

I then use a command button to apply a filter to these records.

I would like to change the command buttom to a toggle switch that
would:
1. apply the filter when it is in the up position
2. remove the filter and show ALL the records when it is in the down
position.

I'm not having much luck. Any suggestions would be appreciated.

Dave


'expanding on what Wayne stated
Private Sub Toggle0_Click()
If Me.Toggle0 then
Me.Filter = "EmpID = 1"
else
Me.Filter = ""
Endif
Me.FilterOn = Me.Toggle0
End Sub

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2285
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the user the ability to toggle so they can see the full content of each table individually. The code I got from the net below works fine for *one* table but when I try to add a 2nd table it does not work. How can I apply this toggle individually to...
2
11937
by: DD | last post by:
I have a command button that applies a filter by customer name, i want a Cmd Button to remove the filter, Access does not supply one can anyone help. Regards DD
0
1383
by: kai | last post by:
Hi, All I have created ADP application with Access2003. I run into a problem when apply Server filter by form. After I applied Server fiter by form, I cannot toggle back to the original state like in Access MDB application can toggle back by click the filter again. Please help Thanks Kai
8
2088
by: swilson513 | last post by:
In Access97 I was able to have an advance filter on a form that had a Like statement so when you applied the filter EACH time it would asked for the criteria. In 2000 the same filter doesn't asked for the criteria after the first time you apply it. Is there a beter way of doing this? TIA
5
3439
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
2
5532
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where...
0
1976
by: gpl666666 | last post by:
I use access to make a "page", below the page form, there are "filter by selection" and "filter toggle button" what are these two bottons for?
4
5440
by: Sheree | last post by:
I have some Access 2003 VBA code that looks like this: Private Sub SubName() Me.FilterOn = True Me.Filter = "" ' Me.FilterOn = False ' Me.Requery x = msgbox("Filter Cleared. Number of Records: " & Me.Recordset.RecordCount)
1
1956
by: swiftouch | last post by:
I'm getting an error message in FF2.0: document.getElementById(toggle) has no properties The goal of the script is, when I hover my mouse over an image, to make one div element visible while making all the others div elements in the array, hidden. thisDocId is the element to avoid hiding. This is the script: <script>
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.