Re: "not responding" and refresh label question
- From: "Rick Rothstein \(MVP - VB\)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 15:33:58 -0500
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?
Two things. First, I am assuming lbl_status is a Label control. If so, you
should not rely on the default property when using it... it makes it harder
for others to read your code. So, first, change this line...
lbl_status = "A currently is: " & a
to this
lbl_status.Caption = "A currently is: " & a
Next, to show its contents as they update, add this line immediately after
it...
lbl_status.Refresh
See if that helps you out.
Rick
.
- References:
- "not responding" and refresh label question
- From: roiegat
- "not responding" and refresh label question
- Prev by Date: Re: del not working in .bat file
- Next by Date: Re: del not working in .bat file
- Previous by thread: Re: "not responding" and refresh label question
- Next by thread: Creating a Specially Formatted Word Document Through Visual Basic
- Index(es):
Relevant Pages
|
Loading