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

How to filter on top of previous filter using VBA?

176 100+
I'm using this code to filter a form:

Expand|Select|Wrap|Line Numbers
  1. Me.Form.Filter = "Remarks Is Null"
  2. Me.Form.FilterOn = True
What code can I use to filter without ruining the previous, already applied filter?

Also, what is the correct syntax to filter using criteria from a control in VBA, for ex. from the control: [forms].[distribution].[remarks]?

Thanks very much.
Dec 13 '06 #1
4 2307
MMcCarthy
14,534 Expert Mod 8TB
Hi Michael,

You could try something like ...

Expand|Select|Wrap|Line Numbers
  1. Me.Form.Filter = "Remarks Is Null Or Remarks=" & Me.ControlName
  2. Me.Form.FilterOn = True
  3.  
Mary
Dec 13 '06 #2
NeoPa
32,556 Expert Mod 16PB
Or, if you don't already know the current value you could use :
Expand|Select|Wrap|Line Numbers
  1. Me.Form.Filter = "(" & Me.Form.Filter & ") Or Remarks=" & Me.ControlName
  2. Me.Form.FilterOn = True
Dec 14 '06 #3
Michael R
176 100+
Thanks, folks.
Dec 16 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
Thanks, folks.
You're welcome Michael

Mary
Dec 16 '06 #5

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...
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...
1
by: Keith | last post by:
A2003, Xp Pro. I've designed a form which contains 6 of combos. Three on the left are set up to select fields from a query, three on the right are set up to select values from the corresponding...
25
by: Johan Bergman | last post by:
Hi, Maybe someone can help me to optimize this C/C++ implementation of a FIR filter (although I realize that I should probably consider an FFT approach instead.) The example below calculates...
3
by: amir | last post by:
How can I filter again my previous filtered records, I mean when I filter an entire I can filter again and again the filtered data. Many thanks for your help. Amir
4
by: bgreer5050 | last post by:
I have a form with various fields with a double click event to bring up a filter via a query. Is it possible to goto another field and apply another filter only to the records that were found...
2
by: Paul | last post by:
Hi all, I have a DataTable and a DataGridView that is using it as a datasource. I'm using the DataTable.Select method and I can find some rows. Is it now possible, somehow to use the result of the...
3
by: emoskalik | last post by:
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 "", " Like ""*""" ...
5
by: wassimdaccache | last post by:
Hello sirs; I do have a continuous form on MS access 2003 I would like to filter this form using the content of the field. I am using this code. Dim y, x As String y =...
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...
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...
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:
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...
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...

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.