View Single Post
  #2  
Old April 28th, 2010, 11:05 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Filter in the subform

There are a couple of ways to do this.
The easiest way is to have the main form filter on the same field that is
the Link child fields and Link master fields.
This way, when the main form is filtered, the subform is automatically
filtered.

If you are not able to do that, then you can set the subform's filter in
code.

With Me.[SubformControlName]
.Filter = strFilter
.FilterOn = True
End With


Note: the subform control name may be different from the name of the form
*inside* the subform control.
You only need the square brackets if the name of the subform control has
spaces or special characters in it.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"samotek via AccessMonster.com" u15330@uwe wrote in message
news:a736653f72fa6@uwe...
Can I apply a filter on the subform? With my main form, called
frmoffers, I
choose the customer and then with the subform I choose the products.I want
to
place a button on my main form to choose the supplier, for example:
strFilter = "products.supplierid = 1"
Me.Filter = strFilter
Me.FilterOn = True

But how can I refer to the subform and can i filter it?

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1