473,414 Members | 1,944 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,414 software developers and data experts.

Delay or Wait Subroutine



I have a VBA program that creates and emails a series of reports to a
mailing list. These reports are queried off tables that are linked over the
internet to a web server. Occasionally, the ODBC connection is dropped on
one of the large reports (perhaps do to high traffic over the web). When
this does happen, I would like to error trap this lost ODBC connection error
and handle it as follows:

(a) Wait 1 Hour
(b) Try to launch the report again.
(c) If item b fails the second time, then close the app.

Question:

Could use recommendation on how to suspend a program's execution for a set
period of time, then resume. Thanks for any help.


Nov 12 '05 #1
4 23228
In VB or VBA you can use the Timer Function, if you look it up in the help
file the example shows exactly how to pause a program for a specified period
of time.
--
Jeffrey R. Bailey
"Mike Wiseley" <mi**********@gte.net> wrote in message
news:Ol*****************@nwrddc02.gnilink.net...


I have a VBA program that creates and emails a series of reports to a
mailing list. These reports are queried off tables that are linked over the internet to a web server. Occasionally, the ODBC connection is dropped on
one of the large reports (perhaps do to high traffic over the web). When
this does happen, I would like to error trap this lost ODBC connection error and handle it as follows:

(a) Wait 1 Hour
(b) Try to launch the report again.
(c) If item b fails the second time, then close the app.

Question:

Could use recommendation on how to suspend a program's execution for a set
period of time, then resume. Thanks for any help.


Nov 12 '05 #2
Thanks. That is exactly what I was looking for.

"Jeffrey R. Bailey" <mr**********@yahoo.com> wrote in message
news:zG********************@twister.tampabay.rr.co m...
In VB or VBA you can use the Timer Function, if you look it up in the help
file the example shows exactly how to pause a program for a specified period of time.
--
Jeffrey R. Bailey
"Mike Wiseley" <mi**********@gte.net> wrote in message
news:Ol*****************@nwrddc02.gnilink.net...


I have a VBA program that creates and emails a series of reports to a
mailing list. These reports are queried off tables that are linked over

the
internet to a web server. Occasionally, the ODBC connection is dropped on one of the large reports (perhaps do to high traffic over the web). When
this does happen, I would like to error trap this lost ODBC connection

error
and handle it as follows:

(a) Wait 1 Hour
(b) Try to launch the report again.
(c) If item b fails the second time, then close the app.

Question:

Could use recommendation on how to suspend a program's execution for a set period of time, then resume. Thanks for any help.



Nov 12 '05 #3
You may also want to look at the Sleep API call. Once you set the API reference for it in
a module, it is real easy to call, just

Sleep LengthOfTime

The advantage of this, is that it releases resources for other apps running on the system
to use. You can find more information about this at

http://www.mvps.org/access/api/api0021.htm

--
Wayne Morgan
MS Access MVP

"Mike Wiseley" <mi**********@gte.net> wrote in message
news:Ol*****************@nwrddc02.gnilink.net...


I have a VBA program that creates and emails a series of reports to a
mailing list. These reports are queried off tables that are linked over the
internet to a web server. Occasionally, the ODBC connection is dropped on
one of the large reports (perhaps do to high traffic over the web). When
this does happen, I would like to error trap this lost ODBC connection error
and handle it as follows:

(a) Wait 1 Hour
(b) Try to launch the report again.
(c) If item b fails the second time, then close the app.

Question:

Could use recommendation on how to suspend a program's execution for a set
period of time, then resume. Thanks for any help.

Nov 12 '05 #4
Thanks.

"Wayne Morgan" <co*****@hotmail.com> wrote in message
news:Ou*****************@newssvr32.news.prodigy.co m...
You may also want to look at the Sleep API call. Once you set the API reference for it in a module, it is real easy to call, just

Sleep LengthOfTime

The advantage of this, is that it releases resources for other apps running on the system to use. You can find more information about this at

http://www.mvps.org/access/api/api0021.htm

--
Wayne Morgan
MS Access MVP

"Mike Wiseley" <mi**********@gte.net> wrote in message
news:Ol*****************@nwrddc02.gnilink.net...


I have a VBA program that creates and emails a series of reports to a
mailing list. These reports are queried off tables that are linked over the internet to a web server. Occasionally, the ODBC connection is dropped on one of the large reports (perhaps do to high traffic over the web). When
this does happen, I would like to error trap this lost ODBC connection error and handle it as follows:

(a) Wait 1 Hour
(b) Try to launch the report again.
(c) If item b fails the second time, then close the app.

Question:

Could use recommendation on how to suspend a program's execution for a set period of time, then resume. Thanks for any help.


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harlin Seritt | last post by:
I am working on making something called a PopMsg widget which is actually identical to a Balloon widget from Pmw. Here is the code: ---code--- from Tkinter import * import time class PopMsg:...
14
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on...
6
by: Salty Dog | last post by:
Code: <%Response.Buffer = False%> <HTML> <HEAD> <title>Printing</title> </HEAD> <BODY> <center> <% FilePath = "c:\WUTemp\441817810_receiver.txt"
6
by: adish11 | last post by:
Hi, In Web Application I would like to create delay for 30 sec in the code to enable external process to run. During the delay in application I would like to show the user message like "Please...
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
18
by: Max | last post by:
This is a follow-up on my previous thread concerning having the program wait for a certain date and time and then executing some code when it gets there. My question is; can I use the Sleep...
14
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I make a 10 second delay? ----------------------------------------------------------------------- There...
0
by: Juanma1 | last post by:
My program is supposed to play a wav file of a ticking clock using the media player object so that only after the file is over (this is to build tension), some textboxes are populated with data...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.