Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Synchronising code and form

Posted on 2001-06-06
6
Medium Priority
?
144 Views
Last Modified: 2010-05-02
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
Comment
Question by:psilli1
6 Comments
 
LVL 6

Expert Comment

by:VK
ID: 6159442
if Progress is a TextBox:

Progress.Multiline = true ?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6159443
Yes.

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

Cheers

0
 
LVL 18

Accepted Solution

by:
deighton earned 200 total points
ID: 6159451
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:WalterM
ID: 6159452
Try to issue a refresh statement like

   Progress.Refresh

immediately after changing the progress bar's properties.

Michel
0
 
LVL 6

Expert Comment

by:VK
ID: 6159453
If not you could try Progress.refresh or DoEvents
0
 
LVL 1

Expert Comment

by:K7
ID: 6159491
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question