Form Non-Response

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
 
V

Van T. Dinh

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.
 
P

Perry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top