Filter on Subform wont turn off!

MackMan

Registered User.
Local time
Today, 20:01
Joined
Nov 25, 2014
Messages
174
I'm know I'm not going stupid here. I'm filtering a sub form in datasheet using an option group frame, and the on click does exactly what I want it to do. Everything works splendidly.

However, Once I'm done filtering, I can either set the filter to all ...

Code:
 Case 1
      Forms!frmmain!frmtoplinelist.form.FilterOn= False
Or click a Button "Remove Filter"
Code:
 Private Sub btnClear_Click()
    Me.frmTopLineList.Form.FilterOn = False
 End Sub
(I've tried both references to the subform too... "Me." and "forms!etcetc"

However, the subform filter isn't switching off.

I'm missing something.. I have to be? Right?
 
Subforms are also filtered by the LinkMasterFields and LinkChildFields properties of the subform control. In design view, selected the subform control, open the property sheet, and check the "data" tab.
 
try clearing the filter string - 'filteron=false' is not the equivalent of remove filter. so try

frmTopLineList.Form.filter=""
 
Awesome Thanks guys for your super fast response...
CJ , you're going to have to start charging me a fee soon!!;)


However, the filter is still there.. the oddest thing.

I've even tried requiring the subform, refreshing it after the 'filter ="' and so on.

I think I may have omitted that the subform is also filtered from an unbound cbo on the main form via a query criteria, so Mark, there is no Master and Child Links.

I think this is causing a problem maybe? I honestly thought it wouldn't do if I blank the filter, and requery the subform.

I will find another way.
 
Sorted.

It was a case of reassigning the subforms recordsource at the end of the "OnClick" and the filter string has gone.

Code:
 Me.Subform.Form.RecordSource = "your Table or QueryHere"
Me.Subform.Form.Requery
 

Users who are viewing this thread

Back
Top Bottom