Solved

Synchronising code and form

Posted on 2001-06-06
6
133 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
Comment Utility
if Progress is a TextBox:

Progress.Multiline = true ?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Yes.

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

Cheers

0
 
LVL 18

Accepted Solution

by:
deighton earned 50 total points
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Expert Comment

by:WalterM
Comment Utility
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
Comment Utility
If not you could try Progress.refresh or DoEvents
0
 
LVL 1

Expert Comment

by:K7
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now