Solved

Synchronising code and form

Posted on 2001-06-06
6
136 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 142

Expert Comment

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

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

Cheers

0
 
LVL 18

Accepted Solution

by:
deighton earned 50 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

808 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