Solved

Synchronising code and form

Posted on 2001-06-06
6
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
Independent Software Vendors: 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

733 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