Results 1 to 3 of 3

Thread: [RESOLVED] [Access 2003] Form Freeze after switching to other App

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Location
    Best Place on Earth
    Posts
    363

    Resolved [RESOLVED] [Access 2003] Form Freeze after switching to other App

    I have a form on my access data base which has a Label on it called LblStatus.

    I use this Label to keep the user up to date with any processes I am running.

    Thus I might use a call of

    Code:
    Squawk "Current Row " & Row
    inside a loop.

    My problem is that if I switch to another application the form stops updating, although the code is running fine.

    The only way I can get the form to resume updating is to use Ctrl-Break and then click Continue.

    Can anyone suggest why this is happening, or better yet how to solve this.


    Code:
    Public Sub Squawk(ByVal Text As String)
    On Error GoTo Err_Squawk
    
        Form_Main.SetFocus
        Form_Main.LblStatus.Caption = Text
        Form_Main.Repaint
        
    Exit_Squawk:
        On Error GoTo 0
        Exit Sub
    
    Err_Squawk:
        ErrorHandler.CentralErrorHandler ModuleName, "Squawk"
        Resume Exit_Squawk
    
    End Sub
    Signature Under Construction

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: [Access 2003] Form Freeze after switching to other App

    Add a doevents call after you've updated the label.
    Form_Main.Repaint << remove this replace with the doevents or doevents:doevents

    doevents (if you click it nand pres f1) releases the code back to the computer to cycle around to other things. This happens to mean that access will refresh its screen.

    If you don't have it then access awaits your code to finish before repainting the screen.

    Hope that helps

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Location
    Best Place on Earth
    Posts
    363

    Re: [Access 2003] Form Freeze after switching to other App

    Thanks Ecniv,

    It works now.

    I had thought that the Repaint was supposed to update the screen each time it was called.
    Signature Under Construction

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width