psilli1
asked on
Synchronising code and form
I am running this piece of code :-
Do Until Len(sFilename) = 0
Progress.Text = Progress.Text & vbCrLf & "Extracting Text from " & sFilename
Call Import_to_access(sFilename )
Progress.Text = Progress.Text & vbCrLf & "Exporting to " & Left(sFilename, Len(sFilename) - 4) & ".dbf"
Call Export_current(sFilename)
sFilename = Dir()
Loop
But the Progress field is not updated until the whole thing has finished. Is it possible to have a way of showing the progress as it goes?
Thanks
Do Until Len(sFilename) = 0
Progress.Text = Progress.Text & vbCrLf & "Extracting Text from " & sFilename
Call Import_to_access(sFilename
Progress.Text = Progress.Text & vbCrLf & "Exporting to " & Left(sFilename, Len(sFilename) - 4) & ".dbf"
Call Export_current(sFilename)
sFilename = Dir()
Loop
But the Progress field is not updated until the whole thing has finished. Is it possible to have a way of showing the progress as it goes?
Thanks
Yes.
Do until ...
...
DOEVENTS
...
Loop
Cheers
Do until ...
...
DOEVENTS
...
Loop
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try to issue a refresh statement like
Progress.Refresh
immediately after changing the progress bar's properties.
Michel
Progress.Refresh
immediately after changing the progress bar's properties.
Michel
If not you could try Progress.refresh or DoEvents
Hi
u should add Progress.Refresh after you set the text property. This method forces the text box to redraw before the rest of the code continues to execue.
Cat
u should add Progress.Refresh after you set the text property. This method forces the text box to redraw before the rest of the code continues to execue.
Cat
Progress.Multiline = true ?