473,385 Members | 1,492 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,385 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 23226
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.