Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2006, 10:15 AM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Countdown

Hi,

I have a form that generates reports for an end user by clicking a button. However, the process can take up to or a little more than half an hour. What I need is some form of timing mechanism on the screen, a sort of "Estimated time remaining: " display.

Currently in my code, I have labels that are made visible as each of the 8 categories of reports are completed. (It is all in a large for loop, so at the end of each loop the code looks something like lblCategory1.visible = true ...which displays "Category 1 reports Done!") However, even this is not updating. It basically just ends up waiting till the whole code is done, and then all 8 of the labels become visible at once, which defeats the purpose.

I should add, during this process, an Excel file is opened (with its visible property is set to false), where the reports are pasted. I don't know if this should affect anything on the view of the form itself.

Please advice!

Thank you,
Kriti

 
Old July 18th, 2006, 12:32 PM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The issues is that the form is not getting a chance to refresh since the loop is so busy. Try add a DoEvents like this:

blCategory1.visible = true
DoEvents



Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com
 
Old July 18th, 2006, 12:37 PM
Authorized User
 
Join Date: Jun 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey boyd,
thanks for replying...
what would the DoEvents do?
kriti

 
Old July 25th, 2006, 02:55 PM
pjm pjm is offline
Authorized User
 
Join Date: Jul 2006
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DoEvents temporarily hands off control to the system so it can do some of what it needs to do (screen updates, etc.) before it hands control back to your code.

-Phil-





Similar Threads
Thread Thread Starter Forum Replies Last Post
Countdown timer DennyLoi Javascript How-To 2 November 27th, 2007 08:01 AM
Countdown Timer stalkingbutler Access VBA 2 April 16th, 2007 10:44 AM
Stopwatch to Countdown cervantes008 Access VBA 1 August 18th, 2006 09:05 AM
Countdown Timer loveperson Beginning VB 6 1 January 7th, 2005 05:31 PM
Countdown clock Ciarano Beginning VB 6 1 March 12th, 2004 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.