触发 MS Access Table 字段验证文本

Trigger MS Access Table Field Validation Text

我在 MS Table 中有一个字段设置为月份编号。

field type = Number 
Field Size = single
Validation Rule= (Not Is Null) or (>0 and <13)
Validation Text = The month must be between 1 and 12
Required=Yes

如果没有输入数据我会得到系统错误"You must enter a value in the dim_daod.daod_month field."

我希望它改为触发验证文本。

验证规则应该是什么?

您希望您的验证规则是

(Not Is Null) And (>0 And <13)

相反。

如果您仍然将 Required 参数设置为 yes,那么您需要拦截数据输入表单上的 "You must enter a value in the field" 消息。

或者,您可以使用相同的条件和消息在 table 级别设置验证

( daod_month Is Not Null) And (daod_month>0 And daod_month<13)