Hourglass disappears suddenly

  • Thread starter robert demo via AccessMonster.com
  • Start date
R

robert demo via AccessMonster.com

I have some code that must go through many calculations on many rows. At
the beginning of the code, I've placed:

DoCmd.Hourglass True


At the end of the code:

DoCmd.Hourglass False

The code in between the two hourglass code lines calls three subroutines.
The subroutines and the main code all point to a global error handler
similar to the following:

Exit_Sub:
DoCmd.SetWarnings True
DoCmd.Hourglass False
Exit Sub

Err_Ctrl:
errMsgStr = ""
ctrlfnctnm = "Form1"
Call GlobalModule_err(Err.Number, Err.Description, Err.Source,
ctrlfnctnm, errMsgStr)
Resume Exit_Sub


The problem. The code typically takes minutes to run. After 1 second the
hourglass disappears and becomes just the typical arrow. I can't figure
out why. If an error occurs, then the error handler has to be invoked
which will give a message box error. This does not occur.

Is there something else that could happen to cause the hourglass to
disappear. I'm at a loss to figure out why this is happening.

Thanks.
 
D

Dirk Goldgar

robert demo via AccessMonster.com said:
I have some code that must go through many calculations on many rows.
At the beginning of the code, I've placed:

DoCmd.Hourglass True


At the end of the code:

DoCmd.Hourglass False

The code in between the two hourglass code lines calls three
subroutines. The subroutines and the main code all point to a global
error handler similar to the following:

Exit_Sub:
DoCmd.SetWarnings True
DoCmd.Hourglass False
Exit Sub

Err_Ctrl:
errMsgStr = ""
ctrlfnctnm = "Form1"
Call GlobalModule_err(Err.Number, Err.Description, Err.Source,
ctrlfnctnm, errMsgStr)
Resume Exit_Sub


The problem. The code typically takes minutes to run. After 1
second the hourglass disappears and becomes just the typical arrow.
I can't figure out why. If an error occurs, then the error handler
has to be invoked which will give a message box error. This does not
occur.

Is there something else that could happen to cause the hourglass to
disappear. I'm at a loss to figure out why this is happening.

Thanks.

I'm not sure I follow you. If you exit one of those subroutines via
code like what you posted:
Exit_Sub:
DoCmd.SetWarnings True
DoCmd.Hourglass False
Exit Sub

you'll turn the hourglass off every time. That exit code isn't part of
the error-handler (unless you've set it up in an unusual way, which you
haven't shown us), but rather will be part of the normal exit for the
procedure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top