?
Solved

TRAPPING A VARIABLE IN ALL SUBS IN ONE CALL

Posted on 2005-03-06
4
Medium Priority
?
268 Views
Last Modified: 2010-05-18
My program contains many subs,
I do trapping during record handling on sub-level like:

Status% = vBookList.Update
If Status% Then
 Dum$ = "In update name," & vbCr & "in phonelist " &  vbCr & "system did not update"
  MsgBox msg, vbCritical, "Update errornr: " & Str$(Status%)
  exit sub
 End If

Now I write this in all databased subs,
Would there be a way to put in a sub or function, or on form-level something like:
"display the call and go back or to form or whatever is needed."
because in data sub will only be:
 if status% then
   call (the_thing_doing_this, err, status%,"Phonebook")
end if



 
0
Comment
Question by:BIAPRO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:BIAPRO
ID: 13470356
extra info, this is in VB6
0
 
LVL 15

Accepted Solution

by:
Ralf Klatt earned 2000 total points
ID: 13470442
Hi,

I'd suggest reading the following article: http://www.andreavb.com/tip010004.html

It is a very good and easy to understand sample about "Error Handler" (standardized error processing across an application) ...

The procedures provide a methodology for the processing of errors in an application. As you build a subroutine simply include the error handling structure provided and all of your errors are handled in a standard way.  The subroutine 'on error' code section invokes the subroutine "sub ErrorHandler()"; it in turn calls "sub MsgLogHandler()" to post various messages in a log file. All source code required for this methodology is included in that write-up!


Best regards,
Raisor
0
 

Author Comment

by:BIAPRO
ID: 13470480
I got the info, its a lot will work on it today, let you know, thanks sofar
Regards,
Jack Biapro
0
 

Author Comment

by:BIAPRO
ID: 13470574
Like my my other question , see the light!
Thanks ,
Jack
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question