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

Filter SubForm

P: 59
I have two forms:
clients
orders

when they both open, when I change clients it automaticly filter the orders for that client.

now I created a form which includes 2 sub forms inside it... (clients and orders)

and it doesn't filter since there is no such form open...
Forms![orders].Filter = "[CustomerID] = " & Me.[CustomerID]


how do I filter a sub form ?
Sep 7 '07 #1
Share this Question
Share on Google+
3 Replies


FishVal
Expert 2.5K+
P: 2,653
I have two forms:
clients
orders

when they both open, when I change clients it automaticly filter the orders for that client.

now I created a form which includes 2 sub forms inside it... (clients and orders)

and it doesn't filter since there is no such form open...
Forms![orders].Filter = "[CustomerID] = " & Me.[CustomerID]


how do I filter a sub form ?
Hi, zivon.

Subform form object could be referenced in the following way.
Expand|Select|Wrap|Line Numbers
  1. Forms![MainForm]![orders].Filter = "[CustomerID] = " & Me.[CustomerID]
  2.  
Sep 7 '07 #2

100+
P: 553
Hi Zivon

The subform does not have to be open when you want to filter it.
See an example how you can reference the subform from main form:

Expand|Select|Wrap|Line Numbers
  1. Me![SubForm].Form.Filter  = "[CustomerID] = " & Me.[CustomerID]
  2.  
If you are note in these forms:
Expand|Select|Wrap|Line Numbers
  1. Forms![MainForm]![SubForm].Form.Filter  = "[CustomerID] = " & Me.[CustomerID]
  2.  
This webpage would be of further help to you:
http://www.mvps.org/access/forms/frm0031.htm

Regards
Qi


I have two forms:
clients
orders

when they both open, when I change clients it automaticly filter the orders for that client.

now I created a form which includes 2 sub forms inside it... (clients and orders)

and it doesn't filter since there is no such form open...
Forms![orders].Filter = "[CustomerID] = " & Me.[CustomerID]


how do I filter a sub form ?
Sep 7 '07 #3

P: 59
thank you : )
that worked perfect.
Sep 7 '07 #4

Post your reply

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