• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

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
0
psilli1
Asked:
psilli1
1 Solution
 
VKCommented:
if Progress is a TextBox:

Progress.Multiline = true ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Yes.

Do until ...
  ...
  DOEVENTS
  ...
Loop

Cheers

0
 
deightonprogCommented:
Do Until Len(sFilename) = 0

 Progress.Text = Progress.Text & vbCrLf & "Extracting Text from " & sFilename

 progress.refresh

 Call Import_to_access(sFilename)

 Progress.Text = Progress.Text & vbCrLf & "Exporting to " & Left(sFilename, Len(sFilename) - 4) & ".dbf"

 progress.refresh

 Call Export_current(sFilename)

 sFilename = Dir()
Loop

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
WalterMCommented:
Try to issue a refresh statement like

   Progress.Refresh

immediately after changing the progress bar's properties.

Michel
0
 
VKCommented:
If not you could try Progress.refresh or DoEvents
0
 
K7Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now