如果IsNull等于True,则返回字段的名称 [英] Returning the names of fields if IsNull equals True

查看:535
本文介绍了如果IsNull等于True,则返回字段的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


[Access 2003]


我想确定是否有更快捷的方法做我正在考虑的事情。我的表格大约有十个字段;一些文本框,一些组合框,一些选项组。


我有一个提交命令,我用它来验证表单以及用户是否在每个表单中输入了一些内容领域。我知道我可以写下以下内容:

Hi everybody,

[Access 2003]

I''m trying to determine if there isn''t a quicker way to do what I''m considering. I have a form with roughly ten fields; some text boxes, some combo boxes, some option groups.

I have a submit command that I''m using to validate the form and whether or not the user has entered something in each field. I know I could write the following:

展开 | 选择 | Wrap | 行号

推荐答案

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


您好OldBirdMan,


感谢您的回复,但我认为你可能错过了我的问题。我正在尝试以编程方式验证字段是否在选择提交命令之前输入了数据。


如果用户没有填写一个或者更多的字段并选择提交命令,我想要一个消息框出现,说明用户忘记填写必填字段,然后在消息框中列出字段的名称。


我很确定如果能弄明白如何检查字段,我可以弄清楚如何将颜色添加到标签上。


也许它会更好我用不同的方式描述了我想要做的事情:
  • 循环表单
  • 如果字段为空,请记住字段或标签名称(我认为标签是
  • 当到达表单结尾时,显示一个返回所有字段名称的消息框
Hi OldBirdMan,

Thank you for the response, but I think you may have missed the point of my question. I''m trying to validate programmatically whether or not a field has had data entered into it prior to the submit command being selected.

If the user doesn''t fill in one or more of the fields and selects the submit command, I want a message box to appear that states that the user forgot to fill in required fields and then lists the names of the fields in the message box.

I''m pretty sure I can figure out how to add the color to the labels if I can figure out how to check the fields.

Maybe it would be better if I described what I''m trying to do in a different way:
  • Loop through the form
  • If a field is blank, remember the field or label name (I think label would be cleaner)
  • When end of form is reached, display a message box that returns all field names


要遍历表单,你可以这样做:

To loop through the form, you can do:

展开 | 选择 | 换行 | 行号


这篇关于如果IsNull等于True,则返回字段的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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