473,406 Members | 2,549 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,406 software developers and data experts.

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 16412
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.net> wrote in message
news:mt********************************@4ax.com...
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
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...
2
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
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...
8
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...
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
2
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...
0
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
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
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...

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.