删除字段中的数据似乎不清除该字段 [英] deleting data in a field doesn't seem to clear the field

查看:96
本文介绍了删除字段中的数据似乎不清除该字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 - 我在表单上有一个字段是必需的。它在一个组合框中。组合框设置为限制到列表。有时,用户进入该字段并开始在该字段中键入以查找其记录。但记录并不存在。因此,他们对他们输入的数据进行退格,并尝试离开该字段(点击按钮添加他们需要的记录),他们收到一条消息,说明该字段是必需的,不能为空。但是,如果它们返回到字段然后点击转义键,则它们可以退出该字段而不显示错误消息。以某种方式退回数据不会使该字段留空,但击中逃脱确实。这对用户来说很困惑。有没有办法解决这个问题(允许它们退格,然后不会出现这个错误)?


感谢您的帮助

解决方案

< blockquote>有人在另一个问题上提出建议,我已尝试过以下方法,但仍然遇到同样的验证错误。


如果Vendor_ID.Dirty = True那么

如果Vendor_ID.Value =""然后

Vendor_ID.Undo

结束如果

结束如果


只需检查cboBox.ListIndex> ; = 0以确保他们选择了一个值而不是空白。


我目前正在使用它在更新前的事件中做同样的事情

展开 | 选择 | Wrap | 行号


Hi - I have a field on a form that is required. It''s in a combo box. The combo box is set to Limit to List. Sometimes a user comes into the field and starts typing into the field to locate their record. But the record doesn''t exist. So they backspace over the data they entered and try to leave the field (to go hit a button to add the record they need) and they get a message saying the field is required and can''t be null. However, if they return to the field and then hit the escape key, they can exit the field without the error message. Backspacing over the data somehow doesn''t leave the field blank, but hitting escape does. It''s confusing for the user. Is there any way around this (allowing them to backspace and then not get this error)?

Thanks for your help

解决方案

At someone''s suggesting on another question, I''ve tried the following, but am still getting the same validation error.

If Vendor_ID.Dirty = True Then
If Vendor_ID.Value = "" Then
Vendor_ID.Undo
End If
End If


Just check for cboBox.ListIndex >= 0 to make sure they have selected a value and not blank.


I am currently using this to do the exact same thing in the before update event

Expand|Select|Wrap|Line Numbers


这篇关于删除字段中的数据似乎不清除该字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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