By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

Delay or Wait Subroutine

P: n/a


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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.