Filter a Subform

campo88

Registered User.
Local time
Today, 23:05
Joined
Nov 20, 2009
Messages
46
On a form I want to filter a subform according to the value chosen on a combo box.


My subform is made from a query and in this query I have the below criteria for one of the fields.
Like [forms]![Results_Form].[combo49] & "*"


I also have the following code, so it requeries:
Private Sub Combo49_AfterUpdate()
Me.Requery
End Sub

The filtering seems to work. However, the problem is that I do not know how to reset a filter so that there is no filter and therefore all the data is showing on my subform. Please help!
 
On the event the subform filter is is to be removed, simply set the filter to Null, e.g.

PHP:
Forms!Mainform!subform.filter = Null
 
You can also try playing with the command FilterOn and try setting to true false as well.
in conjunction they work well.
 
I am getting a run-time error "438" when using that code

"Object does not support this property or method"

??
 
forms!mainform!subform.filteron = true

You can leave this property on and with the filter property equal null, all records will be returned.
 

Users who are viewing this thread

Back
Top Bottom