Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Suppress "Requery" and/or "Repaint" when running function


    I have a couple of "old" right-click functions that mark and un-mark record displays on a continuous form, code below. As the recordset increases in volume, the screen flicker becomes annoying. Is there a way to suppress the requery until the function(s) are complete?

    Code:
    Private Function SelectAll()
    '========================================================================================
    ' Mark "ALL" records as being selected.
    '========================================================================================
    With Me.RecordsetClone
        .MoveFirst
            Do While .EOF = False
            .Edit
            !SelAro = ChrW(9658)
            .Update
            .MoveNext
            Loop
    End With
    
    End Function
    
    Public Function ClearSelects()
    '========================================================================================
    ' Clear the selects within the current RecordSet.
    '========================================================================================
    Me.Recordset.FindFirst "[SelAro] = ChrW(9658)"
    While Me.Recordset.NoMatch = False
        Me.tbSelAro = " "
        Me.Refresh
        Me.Recordset.FindNext "[SelAro] = ChrW(9658)"
    Wend
    Me.Recordset.FindFirst "[SelAro] = Chr(32)"
    
    End Function

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Hi Bill! I haven't needed it, but see if this helps:

    https://msdn.microsoft.com/en-us/vba...-method-access
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks Paul, works like a champ.

    Code:
    Private Function SelectAll()
    '========================================================================================
    ' Mark "ALL" records as being selected.
    '========================================================================================
    
    DoCmd.Echo False
    DoCmd.Hourglass True
    
    With Me.RecordsetClone
        .MoveFirst
            Do While .EOF = False
            .Edit
            !SelAro = ChrW(9658)
            .Update
            .MoveNext
            Loop
    End With
    
    DoCmd.Echo True
    DoCmd.Hourglass False
    
    End Function
    
    Public Function ClearSelects(Dummy As Variant)
    '========================================================================================
    ' Clear the selects within the current RecordSet.
    '========================================================================================
    
    DoCmd.Echo False
    DoCmd.Hourglass True
    
    Me.Recordset.FindFirst "[SelAro] = ChrW(9658)"
    While Me.Recordset.NoMatch = False
        Me.tbSelAro = " "
        Me.Refresh
        Me.Recordset.FindNext "[SelAro] = ChrW(9658)"
    Wend
    Me.Recordset.FindFirst "[SelAro] = Chr(32)"
    
    DoCmd.Echo True
    DoCmd.Hourglass False
    
    End Function

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 04-20-2016, 02:50 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM
  4. Replies: 2
    Last Post: 11-04-2011, 02:45 AM
  5. Replies: 3
    Last Post: 04-10-2010, 10:22 AM

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