抑制第二次验证错误 [英] Supress 2nd Validation Error

查看:94
本文介绍了抑制第二次验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有验证规则和验证文本的文本框。输入新记录时,如果我输入无效文本,验证文本将显示在消息框中,但单击确定后,将显示另一个消息框:

------- ----
myApplication (我泡泡图标)

该值违反了字段或记录的验证规则。


例如,您可能更改了验证规则,但未验证现有数据是否与新验证规则匹配。


单击撤消以恢复先前的值,或输入新值符合字段或记录的验证规则。

[确定] [帮助]

-----------

在此处单击确定后,如果我尝试在不更改任何内容的情况下跳出文本框,则仅获取验证文本消息。因此,第二条消息仅在条目第一次无效时发生。我尝试过使用Form_Error事件和DataErr 7753,但我还是得到了这个额外的消息。该表对文本字段没有限制。我知道如何压制这个吗?


我刚注意到,如果我在结束验证文本消息框后按Escape,它会保存包含无效数据的记录!我做错了什么?

I have a text box with a validation rule and validation text. When entering a new record, if I put in invalid text, the validation text is displayed in a message box, but after clicking OK, another message box is displayed with:
-----------
myApplication (i bubble icon)
The value violates the validation rule for the field or record.

For example, you might have changed a validation rule without verifying whether the existing data matches the new validation rule.

Click undo to restore the previous value, or enter a new value that meets the validation rule for the field or records.
[OK] [Help]
-----------
After clicking OK here, if I try to tab out of the text box without changing anything, I get only the validation text message. So this 2nd message only happens the first time an entry is invalid. I''ve tried using the Form_Error event and DataErr 7753, but I still get this extra message. The table has no restrictions on the text field. Any idea how I can suppress this?

I just noticed that if I press Escape after the closing validation text message box, it saves the record with the invalid data! What am I doing wrong?

推荐答案

我个人不使用表中的可用验证,而是将* all *放在该字段控件的BeforeUpdate事件中在表单和DataEntry / Edit表单的BeforeUpdate事件中。只是我的
I personally do not use the validation available in a table but put it *all* in the BeforeUpdate event of the control for the field in the form and the BeforeUpdate event of the DataEntry/Edit form. Just my


0.02。我觉得它让我对这些消息有了更多的控制权。
0.02. I feel it gives me more control over the messages.


谢谢,我会试一试。如果我在BeforeUpdate甚至控件中放置了一些测试代码和消息框,我需要在表单的BeforeUpdate事件中放入什么?我希望这不是一个愚蠢的问题,我只是不确定BeforeUpdate的事件顺序。
Thanks, I''ll give that a try. If I put some testing code and message box in the BeforeUpdate even of the control, what do I need to put in the BeforeUpdate event of the form? I hope this isn''t a dumb question, I''m just not sure exactly of the sequence of events with the BeforeUpdate.


这篇关于抑制第二次验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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