Form Non-Response

  • Thread starter Thread starter Perry
  • Start date Start date
P

Perry

Hi:

I have a form which I display like a message box that
displays the progress of some action (usually long,
usually in a progress bar). What happens is that the form
stops updating, but the code keeps running. For example:
Progress from 0 to 100 reaches 45 and then stops
updating, then the form closes (normally) as the code
progresses past the completion of the action.

Any ideas?

Thanks
Perry
 
Is the code that calculates the percentage of the work
done correct?
 
It is likely that your CPU is too busy doing the required action and does
not have time to refresh the screen. If you are doing some loop, put
DoEvents in the loop to cede the CPU time to other actions. Alternatively,
use the Repaint Method for the Form.

Check Access VB Help on DoEvents and Repaint.
 
Hi:

I was using the Repain Method already, ie:

Do While rstVar.EOF = False
TotalDone = TotalDone + 1
Forms!messagebox!message.Caption = "Processing " & _
ThisType & " : " & ThisName
Forms!messagebox!progressbar5.Value = _
TotalDone / TotalToDo * 100
Forms!messagebox.Repaint

....
Loop

but I'll try the DoEvents and see what happens

Thanks,
Perry
 
Back
Top