Link to home
Start Free TrialLog in
Avatar of tim_cs
tim_csFlag for United States of America

asked on

Recordset.clone help

I'm doing a clone of a recordset using set newRS = me.recordset.clone.  I'm then setting the filter for the cloned recordset which works fine.  The problem occurs when I try to turn the filter on.  I get an error message saying "Object doesn't support this property or method".  Why am I able to set a filter for the cloned recordset but not turn the filter on?  Is this possible and I'm just doing something wrong?  



Set newRS = Me.Recordset.Clone
    If newRS.RecordCount > 0 Then
        MyBookMark = newRS.Bookmark

        newRS.Filter = MyFilter
        newRS.FilterOn = True   'Error thrown here.
    End If
SOLUTION
Avatar of MikeToole
MikeToole
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
err.. That should have been

  With rs
        .Filter = MyFilter
        Set rs = .OpenRecordset
    End With
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Morning :-)
Avatar of SweetsGreen
SweetsGreen

there is no FilterOn

newRS.Filter = MyFilter '''turns on a filter
newRS.Filter = 0 ''turns off the filter