将代码添加到Access生成的警告消息中 [英] Add code to the Access generated warning message

查看:190
本文介绍了将代码添加到Access生成的警告消息中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些地方,我已为用户启用了警告消息。如果他们点击取消他们会收到错误。


如何为此活动添加代码。我已经跟踪了该程序,但我从未看到实际触发此警告消息的代码。


错误是2501,runSQL操作被取消了。


提前感谢您的帮助

解决方案

您已(意外)在访问文章部分中发布了此问题。这不是一篇文章。

我正在把它移到主要的Access问题论坛。


版主。


< blockquote>我不知道答案,但我可能知道一个人做了;)

如果你能等他的回复,我会给他链接。


在某些地方,我已经为用户启用了警告消息。如果他们点击取消他们会收到错误。


如何为此活动添加代码。我已经跟踪了该程序,但我从未看到实际触发此警告消息的代码。


错误是2501,runSQL操作被取消了。


预先感谢您帮助



如果我正确地解释了你的问题,你指的是系统消息的显示以及当用户决定不运行动作查询时Access生成的后续2501错误。如果是这种情况,那么DoCmd对象的 SetWarnings 方法就是您要寻找的。一个简单的代码块将说明这一点:

展开 | 选择 | Wrap | 行号


In some places I have left the warning messages enabled for the users. If they click cancel they get an error.

How do you add code to this event. I have traced through the program, but I never see the code that actually fires this warning message.

The error is 2501, runSQL action was canceled.

Thanks in advance for the help

解决方案

You have (accidentally) posted this question in the Access Articles section. This is NOT an article.
I''m moving this to the main Access questions forum.

MODERATOR.


I don''t know the answer to this but I may well know a man who does ;)
I''ll PM him the link if you can wait for his response.


In some places I have left the warning messages enabled for the users. If they click cancel they get an error.

How do you add code to this event. I have traced through the program, but I never see the code that actually fires this warning message.

The error is 2501, runSQL action was canceled.

Thanks in advance for the help

If I interpret your question correctly, you are referring to the display of System Messages and the subsequent ''2501'' Error that Access generates when the User decides not to run an Action Query. If this is the case, then the SetWarnings Method of the DoCmd Object is what you are looking for. A simple code block will illustrate this point:

Expand|Select|Wrap|Line Numbers


这篇关于将代码添加到Access生成的警告消息中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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