473,386 Members | 1,846 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,386 software developers and data experts.

filter buttons

I have a contacts form with buttons that filter the form by last name.
The buttons code looks like this (a different button for each letter
in the alphabet)

DoCmd.ApplyFilter "", "[LastName] Like ""[J]*"""

This works great but now I want to do the same thing but with the
FirstName field. My problem is that when i click on my new filter
button my previous filter for the LastName gets cleared. How can i
have my second filter apply to the filtered results of my first filter
using a button?
Thanks!

Sep 25 '07 #1
3 2732
<em*******@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
>I have a contacts form with buttons that filter the form by last name.
The buttons code looks like this (a different button for each letter
in the alphabet)

DoCmd.ApplyFilter "", "[LastName] Like ""[J]*"""

This works great but now I want to do the same thing but with the
FirstName field. My problem is that when i click on my new filter
button my previous filter for the LastName gets cleared. How can i
have my second filter apply to the filtered results of my first filter
using a button?
Thanks!
Try:

Me.Filter = Me.Filter & " And [FirstName] Like ""T"""
Me.FilterOn = True

I usually use the Me.Filter and the Me.FilterOn properties, instead of
DoCmd.ApplyFilter. I don't know the difference.

Fred Zuckerman
Sep 25 '07 #2
On Tue, 25 Sep 2007 05:39:44 -0700, "Fred Zuckerman"
<Zu********@sbcglobal.netwrote:

Just put an * after the T
-Tom.

><em*******@gmail.comwrote in message
news:11**********************@k79g2000hse.googleg roups.com...
>>I have a contacts form with buttons that filter the form by last name.
The buttons code looks like this (a different button for each letter
in the alphabet)

DoCmd.ApplyFilter "", "[LastName] Like ""[J]*"""

This works great but now I want to do the same thing but with the
FirstName field. My problem is that when i click on my new filter
button my previous filter for the LastName gets cleared. How can i
have my second filter apply to the filtered results of my first filter
using a button?
Thanks!

Try:

Me.Filter = Me.Filter & " And [FirstName] Like ""T"""
Me.FilterOn = True

I usually use the Me.Filter and the Me.FilterOn properties, instead of
DoCmd.ApplyFilter. I don't know the difference.

Fred Zuckerman
Sep 25 '07 #3
Oops, thanx Tom.

"Tom van Stiphout" <no*************@cox.netwrote in message
news:ji********************************@4ax.com...
On Tue, 25 Sep 2007 05:39:44 -0700, "Fred Zuckerman"
<Zu********@sbcglobal.netwrote:

Just put an * after the T
-Tom.

>><em*******@gmail.comwrote in message
news:11**********************@k79g2000hse.google groups.com...
>>>I have a contacts form with buttons that filter the form by last name.
The buttons code looks like this (a different button for each letter
in the alphabet)

DoCmd.ApplyFilter "", "[LastName] Like ""[J]*"""

This works great but now I want to do the same thing but with the
FirstName field. My problem is that when i click on my new filter
button my previous filter for the LastName gets cleared. How can i
have my second filter apply to the filtered results of my first filter
using a button?
Thanks!

Try:

Me.Filter = Me.Filter & " And [FirstName] Like ""T"""
Me.FilterOn = True

I usually use the Me.Filter and the Me.FilterOn properties, instead of
DoCmd.ApplyFilter. I don't know the difference.

Fred Zuckerman

Sep 25 '07 #4

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

Similar topics

1
by: jeffgeorge | last post by:
Hi all. Trying to move Filter By Selection, Filter By Form, and Apply/Remove Filter directly into my form. No luck. Is there anyway to move them into the header of the form or, as another...
16
by: Nhmiller | last post by:
I already have a report designed under Reports. When I use filtering in Forms or Tables, I see no way to select that filtered list when I am in Reports, and there appears to be no way to do the...
2
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
2
by: chiinook | last post by:
I have been creating a contact management database which now has about 300 records in it. I've been filtering using the "filter by form" command but I'd like to automate this with a set of buttons...
3
by: mattscho | last post by:
Hi All, Trying to create a set of 3 buttons in a form that have the same effect as the "Filter by Form", "Apply Filter" and "Remove Filter" Buttons on the access toolbar. Help would be muchly...
1
by: mattscho | last post by:
Re: Filter By From, Apply Filter, Remove Filter Buttons in a Form. -------------------------------------------------------------------------------- Hi All, Trying to create a set of 3 buttons in...
15
by: Briansmi1116 | last post by:
I created two buttons, that filter my form, They filter in different Fields, and if one is filtered, and the other is not there is a certain amount of record, if they are both pushed, then there is...
1
by: eHaak | last post by:
A couple years ago, I built a database in MS Access 2003. I built the form using macros in some of the command buttons, and now I’m trying to eliminate the macros and just use visual basic code. ...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.