Results 1 to 4 of 4
  1. #1
    Zakkie is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    4

    Slow forms buildup after clearing filter with no records


    I have a MS Access client with a SQL database with linked tables and views.


    In some forms I display records from a SQL view which works good. The form is a main form with a subform. Mainform does not have a recordsource, the subform has a recordsource which is a linked SQL view that is filtered. No performance issues.

    So, the initiale subform.recordsource is like "select * from vw_Projects where Project_ID=" & form!projectID

    I have created a Form!Search field on the main form which - through VBA - builds a filterstring for searching in (most) of the fields of the subform and combines it with the recordsource. This all works good, except when the filter has no results, i.e. the subform does not display a searchresult:

    When I clear the searchfield after it displays no results, the subform is reset to the "unfiltered" recordsource, and then the following happens: the unfiltered recordsource is displayed (fast), then cleared, and then rebuilds really really slow multiple times. UI becomes unresponsive for at least 60sec while repeatedly rebuilding the records slowly, untill it is finished doing whatever it's doing

    When I clear the searchfield after it has displayed a result (some records that match the filter), it only rebuilds once (fase)

    Bit more detail:
    The searchfield triggers a VBA function to build a filterstring and then set the form recordsource, like (simplified):
    searchfield = "car"
    -----> strFilter = " AND [item] like *" & form!searchfield & "*"

    subform.recordsource = "select * from vw_Projects" & strFilter

    - I've tried using a form.filter instead of a dynamic recordsource, but it's exactly the same.
    - Also, some fields on the subform have Conditional formatting, but removing that also does not make a difference.
    - I've also tried to see if something "double" is going on between the formevents which might cause the
    - since the (linked) SQL view does not display performanceproblems - it's not blazing fast but good enough - I do not think it has anything to do with SQL server

    The problem only occurs after resetting the filter after it has no results. I'm trying to find what causes this second slow repeating buildup, but so far no luck.

    Anyone?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Zakkie is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    4
    Yes. Are these forums related? I'm sorry, If so, my post can be closed

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    Quote Originally Posted by Zakkie View Post
    Yes. Are these forums related? I'm sorry, If so, my post can be closed
    Whether they are related or not makes no difference to the etiquette of cross-posting, as you would understand if you had taken the trouble to read the link that I posted about the subject.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trouble clearing records on a form
    By NightWalker in forum Programming
    Replies: 5
    Last Post: 04-21-2020, 04:18 PM
  2. Slow .MDE file when loading forms
    By Cschmitt in forum Access
    Replies: 2
    Last Post: 07-22-2015, 09:14 AM
  3. Replies: 3
    Last Post: 07-11-2014, 08:13 AM
  4. Clearing a subform filter
    By Fish218 in forum Forms
    Replies: 1
    Last Post: 03-28-2013, 02:25 PM
  5. Slow response over VPN or To Filter or not To Filter
    By rcrobman in forum Database Design
    Replies: 0
    Last Post: 04-30-2011, 02:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums