how to avoid the "not responding" state?

  • Thread starter Thread starter Kamil
  • Start date Start date
K

Kamil

I've created a form, which shows me the status (progress barr and
remaining time estimation) of current calculations on my db (VBA).
Very often it just freezes and becomes "not responding" (Windows XP).

Can I do anything to avoid such state?

Thanks,
Kamil
 
It's usually caused by accidently creating and endless loop in the code, set
code breaks & remove 'on error resume next' if you have it & test the code
piece by piece with data that causes the lockout. You can use ctrl+break to
try and enter the code when it locks up.
 
It's usually caused by accidently creating and endless loop in the code, set
code breaks & remove 'on error resume next' if you have it & test the code
piece by piece with data that causes the lockout. You can use ctrl+break to
try and enter the code when it locks up.

It's not the case - the code runs without any breaks, and after
~20minutes it's finished and Access is responding again.
But when it's not responding I can't see the progress...
So my question is about some vba function which will let Windows know,
that Access is ok.
 
Kamil - presumably if your doing a 20 min calculation it is a Do or For loop
type construct.

Have you got a DoEvents in your loop to let the progress form update?

Try looking on the microsoft.public.vb.general.discussion group. There's
loads of posts on ProgressBars and DoEvents.

HTH
 
agreed, the only way I can reproduce a 'Not Responding' is without a DoEvents
in the loop although not having a Repaint to update the form with the
progress meter might eventually cause it, but I can't replicate that here.
 
agreed, the only way I can reproduce a 'Not Responding' is without a DoEvents
in the loop although not having a Repaint to update the form with the
progress meter might eventually cause it, but I can't replicate that here..

Actually I'm only using MyForm.Repaint method.
about DoEvents - help says:
Dim I, OpenForms
For I = 1 To 150000 ' Start loop.
If I Mod 1000 = 0 Then ' If loop has repeated 1000 times.
OpenForms = DoEvents ' Yield to operating system.
End If
Next I ' Increment loop counter.

I'll test it, thanks!
 

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

Back
Top