473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

a makeshift progress bar

Hello, I wrote some code that loops over several thousands .CSV files, imports them into a remote table, alters the data to be compatible with the database, and stores them in another remote table. After every file it also checks both the import to and export to tables to ensure they are not approaching the size limit. If the export table is approaching the size limit, it simply creates a new table and starts writing to that. If the import table is approaching the size limit, it compacts the table (the import table is cleared out before every import).

Anyway, between each successful .CSV file upload, I would like to update a text box ,on the form, with the total size of the files thus far successfully compiled, combined with the starting size of the entire folder with .CSV files in it, and of course an expected time of finish.

This is all very easy math, and I have it set to do exactly what I want it to, except it doesn't actually refresh the values of these text boxes until the code is finished. Is there a way to get it to do so without prompting the user for some type of input?

The bottom line is exactly that. I could post the code if someone really thinks it would be useful to know, but there's tons of it. Here's some fake pseudo-code that is essentially the same thing I want done:

Expand|Select|Wrap|Line Numbers
  1. x = 1
  2. while x <= one hundred trillion
  3.  if x mod one trillion = 0 then
  4.   [Text0] = x / one trillion 
  5.  end if
  6.  x = x + 1
  7. wend
  8.  
currently, if i were to run this in access, the form would "freeze up" while the code is running, and then display 100 at the end. I would like it to display the count (1.... 2..... 3.... et cetera).
Dec 22 '10 #1
7 2573
Rabbit
12,516 Expert Mod 8TB
Interface updates only occur after the code has finished running. To get what you want, you will need to use the timer event of the form and track the progress using global variables.
Dec 22 '10 #2
does the timer event code work while other code is running?

i didn't know that.
Dec 23 '10 #3
Rabbit
12,516 Expert Mod 8TB
It won't run while other code is running. If code is currently running, it will trigger and then go in a queue to wait its turn. Therefore, you will have to move the csv file upload into the timer event and track which file you're on using global variables.
Dec 23 '10 #4
munkee
374 256MB
Could you just add a line in to your code to requery the textbox through each iteration? I haven't ever had to do what you are explaining but it is what I would be trying if I were.
Dec 23 '10 #5
Rabbit
12,516 Expert Mod 8TB
Requerying a textbox results in an interface update. The results won't show until the code returns from execution.
Dec 23 '10 #6
RuralGuy
375 Expert 256MB
Have you tried putting some DoEvents to allow the Tasker to run?
Dec 26 '10 #7
ADezii
8,834 Expert 8TB
I created a simple Demo for you that will indicate how you can visually display the progress of an ongoing process with nothing more than a couple of Label Controls. Download the Attachment, and if you have any questions, please feel free to ask.
Attached Files
File Type: zip Progress Bar.zip (16.9 KB, 130 views)
Dec 26 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: SpamProof | last post by:
I got an animated gif that is a barber pole spinning that I want to use as a progress bar. The problem is that is stops spinning (shows 1 frame) when my browser is processing a submited request...
7
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
1
by: scorpion53061 | last post by:
this code came from cor and I think Armin authored it. I am trying to download an access database and track its progress. It is reading the size fo the file but I am unsure of how to get the...
8
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
15
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
5
by: Aggelos | last post by:
Hello I am doing sevreral scripts like sending a newsletter that might take a while to finish first to prevent the browser from timing out and to keep the user informed of the process progress I...
5
by: MLH | last post by:
Was wondering if anyone has constructed a progress bar out of colored rectangle to go on a form, varying its width say between zero and 3-inches with the actual width being directly proportional...
10
by: Robertf987 | last post by:
Okay, now then. I'm hoping somebody can help here, pretty please. I want to make a progress bar/indicator on a form. At first I was just going to insert an animated gif, but I've tried and remembered...
0
by: jags_32 | last post by:
Hello We use MFG-PRO as our ERP system which in turn uses Progress databases. In the old version of SQL 2000, using DTS packages, we used to set the code page via command prompts and execute DTS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.