If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Filter in the subform
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 |
#2
|
|||
|
|||
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 |
Thread Tools | |
Display Modes | |
|
|