UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Global error handler fails when there is an overflow error    
 
   
bobdee
post Aug 19 2006, 11:50 PM
Post #1

UtterAccess Guru
Posts: 877



I use a global error handler which I originally got from the Archive. However, it does not seem to handle the overflow error. When there is an overflow error I get an unhandled error in the error handler. Here's typical error handler code (the one shown is used in an Outlook automation routine).

CODE


Exit_Sub:  On Error Resume Next

Set OutlookApp = Nothing
Set objOLNamespace = Nothing
Set objOLTask = Nothing
Set OutlookTask = Nothing
Set OutlookPattern = Nothing
Set outItem = Nothing


DoCmd.SetWarnings True
Exit Function

Err_Ctrl:


DoCmd.Hourglass False
errMsgStr = ""
ctrlfnctnm = "CreateOutlookTasks"
Call Utilities_err(Err.Number, Err.DESCRIPTION, Err.Source, ctrlfnctnm, errMsgStr)
Resume Exit_Sub


The unhandled error stops the code on the following line:

Call Utilities_err(Err.Number, Err.DESCRIPTION, Err.Source, ctrlfnctnm, errMsgStr)

Sorry about the way the code looks. I just can't seem to get the blank lines to show up in the post even though they are there when I create the post.


How can I "handle" this error.

Thanks.
Go to the top of the page
 
+
R. Hicks
post Aug 19 2006, 11:54 PM
Post #2

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



To get the blank lines when using the code markup .. place your cursor in the blank line and insert a space to the line ...

RDH
Go to the top of the page
 
+
KantWin
post Aug 20 2006, 11:44 AM
Post #3

UtterAccess Guru
Posts: 547
From: Alabama



Howdy!

I have this same problem, and I used the error handler code from the Archive as well.
It appears to be a problem when the error handler is called too many times due to repeated errors in the code. Not the error handler code, but the code where the error occurs.
Other than that, I don't have a solution, sorry.
Go to the top of the page
 
+
CyberCow
post Aug 21 2006, 07:20 AM
Post #4

UdderAccess Admin + UA Ruler
Posts: 15,648
From: Upper MI



In A2K3, an overflow should be error #6 and if the error actually is an 'overflow' (#6), then that too should be trappable.

Try setting a condition for #6 (Iff Err.Number = 6 Then . . .)

Please let me know how that works.
Go to the top of the page
 
+
bobdee
post Aug 21 2006, 04:40 PM
Post #5

UtterAccess Guru
Posts: 877



I think your suggestion would mean putting this If Err.Number = 6 in each local error handler that calls the global. I don't have a convenient way to do this since it's too much text/lines for the Find/Replace and I have hundreds if not thousands of code modules that use the global error handler.

You're right it is error #6 and I don't know why it isn't trapped either.
Go to the top of the page
 
+
CyberCow
post Aug 22 2006, 11:05 AM
Post #6

UdderAccess Admin + UA Ruler
Posts: 15,648
From: Upper MI



You should be able to stop it at the global (destination) point, thus avoiding the need to trap it at every level.

Not sure but may be worth a try.
Go to the top of the page
 
+
bobdee
post Aug 24 2006, 09:00 AM
Post #7

UtterAccess Guru
Posts: 877



No, I don't think that will work. The error shows up in the local module on the line where the call is made to the global module.

Or am I not understanding what you're saying.

Edited by: bobdee on Thu Aug 24 10:01:23 EDT 2006.
Go to the top of the page
 
+
CyberCow
post Aug 25 2006, 07:11 AM
Post #8

UdderAccess Admin + UA Ruler
Posts: 15,648
From: Upper MI



I'm afraid that you just might need to modify each module in that case. Speed Ferret is an excellent tool for handling tons of Find/Replace string.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 12:37 PM