Refresh/Requery don't seem to work while doing file I/O 
Author Message
 Refresh/Requery don't seem to work while doing file I/O

Code sample below:
I am trying to show progress 10%, 20%, ... via a label while reading in a
large (6 Mb) file.  Even though I have Requery and Refresh Access won't
update the screen until the entire file is done.

Why does it not update and how can I workaround?

P.S
This is was just a test to see if the concept would work, what I really want
to do is show a progress bar.

 While Not EOF(intFileNo)

        'See if it is time to update
        If (Seek(intFileNo) / lngFileLength) > intStep Then
            lblProgress.Caption = intStep * 100 'Display percent complete
            Me.Requery
            Me.Refresh
            intStep = intStep + 0.1
        End If

        'Input the entire line
        strTextLine = Input(CintInputFileLineLength, #intFileNo)
Wend

--
Please respond to the newsgroup AND the author:

Thanks
Shawn



Sat, 05 Jan 2002 03:00:00 GMT  
 Refresh/Requery don't seem to work while doing file I/O

Quote:

> Code sample below:
> I am trying to show progress 10%, 20%, ... via a label while reading in a
> large (6 Mb) file.  Even though I have Requery and Refresh Access won't
> update the screen until the entire file is done.

> Why does it not update and how can I workaround?

> P.S
> This is was just a test to see if the concept would work, what I really want
> to do is show a progress bar.

>  While Not EOF(intFileNo)

>         'See if it is time to update
>         If (Seek(intFileNo) / lngFileLength) > intStep Then
>             lblProgress.Caption = intStep * 100 'Display percent complete
>             Me.Requery
>             Me.Refresh
>             intStep = intStep + 0.1
>         End If

>         'Input the entire line
>         strTextLine = Input(CintInputFileLineLength, #intFileNo)
> Wend

Inside your loop, after you update your caption, simply run:

'***
DoEvents
'***

which should return the control to the computer so it will update the screen for
you....

--
HTH
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|  gHaD (Aaron Robinson) | Microsoft MVP [Access] |
| MJM-PC Solutions, Inc. |Web & Database Developer|
|       Chicago, IL      |   Will work for Dew?!  |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Sat, 05 Jan 2002 03:00:00 GMT  
 Refresh/Requery don't seem to work while doing file I/O
Try putting a doevents statement in your loop

Quote:

>Code sample below:
>I am trying to show progress 10%, 20%, ... via a label while reading in a
>large (6 Mb) file.  Even though I have Requery and Refresh Access won't
>update the screen until the entire file is done.

>Why does it not update and how can I workaround?

>P.S
>This is was just a test to see if the concept would work, what I really
want
>to do is show a progress bar.

> While Not EOF(intFileNo)



Sat, 05 Jan 2002 03:00:00 GMT  
 Refresh/Requery don't seem to work while doing file I/O
Using requery and refresh will just slow you down. They affect the
data, not the screen. You can use DoEvents, as Aaron suggested, or you
could try Me.Repaint.

If what you really want is a progress bar, then take a look at the
SysCmd function. Among the many unrelated things it allows you to do
is creation and maintenance of a progress meter in the status bar.

 -- Andy

Quote:

>Code sample below:
>I am trying to show progress 10%, 20%, ... via a label while reading in a
>large (6 Mb) file.  Even though I have Requery and Refresh Access won't
>update the screen until the entire file is done.

>Why does it not update and how can I workaround?

>P.S
>This is was just a test to see if the concept would work, what I really want
>to do is show a progress bar.

> While Not EOF(intFileNo)

>        'See if it is time to update
>        If (Seek(intFileNo) / lngFileLength) > intStep Then
>            lblProgress.Caption = intStep * 100 'Display percent complete
>            Me.Requery
>            Me.Refresh
>            intStep = intStep + 0.1
>        End If

>        'Input the entire line
>        strTextLine = Input(CintInputFileLineLength, #intFileNo)
>Wend

>--
>Please respond to the newsgroup AND the author:

>Thanks
>Shawn



Sun, 06 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. One out of every two .Requery don't work on my small LAN

2. One out of every two .Requery don't work on my small LAN

3. Requeries don't work?

4. variable objects don't seem to work

5. VB hooks to WORD don't seem to work with Word 2000 SP1

6. Tool tips don't seem to work

7. MSFlexGrid Refresh doesn't seem to work

8. DataEnv, ADO and VB6 Problem - Requery on command does not seem to work

9. End of File doesn't seem to work

10. .asp Files Don't Refresh!

11. File opened for Binary read BUT instr doesn't seem to work

12. MovePrevious don't work but the MoveNext work's fine

 

 
Powered by phpBB® Forum Software