|
-
Aug 29th, 2008, 07:28 AM
#1
Thread Starter
Hyperactive Member
[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 
-
Aug 29th, 2008, 07:50 AM
#2
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
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...
-
Aug 29th, 2008, 07:57 AM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|