使用模块来捕获错误 [英] Using a module to trap errors

查看:62
本文介绍了使用模块来捕获错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想知道这是可能的。


基本上,我目前所做的是使用Form_Error()事件捕获

erros并显示客户错误消息。


问题是,我需要以各种形式执行此操作。当然,我知道这是必不可少的。但是在Form_Error事件期间是不是有办法使用模块调用?


示例:而不是:

展开 | 选择 | Wrap | 行号

解决方案

请参阅以下链接,了解示例全局错误处理程序与程序错误处理程序:

http://www.vb123.com/Toolshed/04_acc...orhandling.htm

http://www.allenbrowne.com/ser-23a.html

如果您同意程序错误处理更好,更安全,更安全.....但希望有一种方法可以减少所涉及的工作量,请参阅此链接以获取价格低于


30的第三方工具。

http://www.aadconsulting.com/errhdoff.html

谢谢puppydogbuddy。但是在我发布之前我已经看过这个链接了。

这不能解决我的问题。


这两个页面仍然讨论在每个ErrorHandler中调用过程表单模块中的每个子目录。

第二个链接甚至没有谈论模块,而是局部错误处理。

第一个链接使用标准模块功能,但是,我仍然会

需要从每个子的ErrorHandler调用该函数。

展开 | 选择 | Wrap | 行号


Hi guys, I am wondering it this is possible.

Basically, what I do currently is use the Form_Error() event to trap
erros and display customer error messages.

Problem is, I need to do this in every form. Of course, i know this is
essential. But wouldn''t there be a way to use a module to call during the Form_Error Event?

Example: Instead of doing:

Expand|Select|Wrap|Line Numbers

解决方案

see these links for sample global error handler vs procedural error handler:

http://www.vb123.com/Toolshed/04_acc...orhandling.htm

http://www.allenbrowne.com/ser-23a.html

If you agree that procedural error handling is better,safer and more secure.....but wish there is a way to reduce the work effort involved, see this link for a third party tool costing less than


30.

http://www.aadconsulting.com/errhdoff.html


Thank you puppydogbuddy. But I have seen this links already before I posted.
This does not solve my problem.

Both pages still talks about calling the procedure within EVERY ErrorHandler of every sub in the form module.
The 2nd link doesn''t even talk about modules but local error handling.
The 1st link uses a standard module function, however, I would still
need to call the function from the ErrorHandler of every sub.

Expand|Select|Wrap|Line Numbers


这篇关于使用模块来捕获错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆