By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

How to filter on top of previous filter using VBA?

100+
P: 176
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
Share this Question
Share on Google+
4 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
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
Expert Mod 15k+
P: 31,186
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

100+
P: 176
Thanks, folks.
Dec 16 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks, folks.
You're welcome Michael

Mary
Dec 16 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.