Re: "not responding" and refresh label question




<roiegat@xxxxxxxxx> wrote in message
news:1164053703.387941.244590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I've been looking at all the different solutions on this group for an
application showing "not responding" when it is actually working. But
I have a further problem.

First a little background. My app is accessing an access database that
has approx 52k records. It has the fun task of trying to see if any of
those records duplicates. So it does this with the following:

(code isn't exact, but just shows method)

'connect to database.....
For a=1 to (record_size-found)
lbl_status="A currently is: " & a
database.Movefirst
Do While Not databse.EOF
If a.info=current_record.info then
found=found+1
end if
database.MoveNext
Loop
Next a


Thats a quick summary of it...standard loop inside a loop trick. What
happends when this runs is that the lbl_status will go white after
about 10 seconds and after about a minute the menubar shows "not
responding". I've let it run before and told it to stop at certain
points (like when found=10) and it does stop at the right places. But
what I'd like it primary to be able to see the lbl_status updating and
not have it show up as a white block.

I've tried various things. I tried the sleep method, that didn't help
much. I tried writing a loop that goes nowere - that helped with the
"not responding" but didn't let me see the lbl_status update - still a
white block.

Any suggestions?


Try something like this:

...
If (a mod 100)=0 Then DoEvents
Next a

Be careful though - it will allow users to click buttons or do something on
the form, which, generally, shouldn't be done until procedure ends. You
might need to decrease/increase denominator after some experiments.

Additionally, have you ever considered doing it using SQL? - it would be
much faster and simpler

Dmitriy.


.


Loading