简体   繁体   English

Microsoft Access验证公式

[英]Microsoft Access Validation Formula

In ms access, how to write a validation formula for maximum of two letters in a field, first one being a letter and the second one being a number? 在ms Access中,如何编写一个字段中最多两个字母的验证公式,第一个为字母,第二个为数字?

Eg A9 (allowed) B5 (allowed) BB5 (not accepted) DD (not accepted) 23 (not accepted) 例如A9(允许)B5(允许)BB5(不接受)DD(不接受)23(不接受)

I think setting the Validation Rule for the field at table level to the following should work: 我认为将表级别的字段的验证规则设置为以下内容应该起作用:

IS NULL OR Like "[A-Z]#"

This will accept characters between A and Z for the first character and the # is to accept numbers in the second character space. 这将接受第一个字符在A和Z之间的字符,而#将接受第二个字符空间中的数字。 I added the Is Null Or but you may want to remove it. 我添加了“ Is Null OrIs Null Or但您可能希望将其删除。

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM