Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Refreshing filter on subforms on pages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vicki - 01 Feb 2008 17:39 GMT
I have a search form with 2 pages and 2 subforms.  When I set the filter it
does not work unless I click on the page or hit the search twice.  I put a
msg in the code and it shows the filter being set.  I tried to do a requiry
on the subforms but got the same results.  Below is a portion of the code.

        Me.sbfrmTownCalls.Form.Filter = strWhereC
        Me.sbfrmTownIssues.Form.Filter = strWhereI            
       
       Me.sbfrmTownCalls.Form.FilterOn = True
       Me.sbfrmTownIssues.Form.FilterOn = True
       MsgBox "Filter Set"
       
       'DoCmd.Requery "SbFrmTownIssues"
       'DoCmd.Requery "SbFrmTownCalls"

Signature

Vicki

Allen Browne - 02 Feb 2008 02:45 GMT
You do have to set both the Filter and FilterOn.
(You should not need the Requery.)

This suggestion:
a) Checks to see if anything needs saving first.
b) Applies the filter and sets FilterOn before moving to the other subform.

   With Me.sbfrmTownCalls.Form
       If .Dirty Then .Dirty = False
       .Filter = strWhereC
       .FilterOn = True
   End With
   With Me.sbfrmTownIssues.Form
       If .Dirty Then .Dirty = False
       .Filter = strWhereI
       .FilterOn = True
   End With

If that still fails, something else must be interfering. For exmple, the
form may be being dirtied in Form_AfterUpdate or Form_Current, or a Timer
event could be messing it up.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a search form with 2 pages and 2 subforms.  When I set the filter it
> does not work unless I click on the page or hit the search twice.  I put a
[quoted text clipped - 11 lines]
>        'DoCmd.Requery "SbFrmTownIssues"
>        'DoCmd.Requery "SbFrmTownCalls"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.